Deprecated: Return type of ResultWrapper::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 174

Deprecated: Return type of ResultWrapper::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 192

Deprecated: Return type of ResultWrapper::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 185

Deprecated: Return type of ResultWrapper::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 202

Deprecated: Return type of ResultWrapper::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 163

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 104

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 104

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 105

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 105

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 106

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 106

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/skins/SkinTemplate.php on line 313

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104
Introduction to Coding Workspace Objects - Rave Documentation

Introduction to Coding Workspace Objects

From Rave Documentation
Jump to: navigation, search

Introduction

The components of a Workspace Object

Note: Throughout this discussion I use “axes” as a singular noun meaning “the thing that gets created by MATLAB when you enter the command axes()”.

At a minimum, each graph must include 3 axes. Even though you only see one axes, there are actually 3 of them stacked on top of each other. Using multiple axes stacked on top of each other allows more formatting options, such as different colored gridlines. It also givs each graph 3 userdata properties, each of which is used by rave for a particular purpose. The 3 axes are:

  • handles.allgraphs(ai) = this is the main axes… the one in which you actually plot the data. The userdata of this axes
  • handles.fakeax(ai) = this is the next axes down. This axes doesn’t really do anything, but you can use it if you need to plot something at an intermediate layer. Important: The udata for your graph MUST be stored in this axes’s userdata property, i.e. set(handles.fakeax(ai),’userdata’,udata) and udata=get(handles.fakeax(ai),’userdata’,udata).
  • handles.fakerax(ai) = the bottom axes. This axes is used to display the graph’s background color and gridlines.

These three axes are created by the function ravenewgraph, which is ALWAYS run when the user makes a new graph and before your graph’s creation function is run. Thus these axes will already exist when your function gets run, so you don’t need to create these. You can access them using the fields indicated above.

IMPORTANT: Any plotting commands (e.g. plot,line,scatter,patch,surf,text) MUST take one of the above axes as a parent (unless you are making a matrix graph, described below). ALSO – BEWARE: many “high level” plotting commands will reset the userdata property of the axes. So you will need to set it again AFTER you finish plotting. For example, handles.allgraphs(ai)’s userdata should contain the keyword for your graph, something like “scatter”, but after you plot into the axes, it may get reset to an empty matrix. So check at the end of your graph creation function that it still says “scatter”. Otherwise rave won’t know which tabs to load when the user selects your graph (among other problems).

If you are making a matrix graph with multiple axes (I use “matrix graph” to refer to any graph that comprises multiple visible axes, regardless of whether they are actually layed out in a matrix), the 3 axes listed above will still be created. DON’T delete them, just make them invisible in your graph creation function, then create your own matrix of axes, EACH OF WHICH SHOULD ALSO STILL BE STACKED 3 high. Note: I recommend you use the position of handles.allgraphs(ai) to determine the boundary within which your graph matrix will be placed. See ravecreatescattermatrix.m for an example of how to do this.

Note: The “ai” (handles.activeindex) associated with each graph does not change when you delete a graph. If you have 3 graphs and you delete the second one, then you just have no graph with ai=2.


Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37