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
Axes Tick Marks and Labels - Rave Documentation

Axes Tick Marks and Labels

From Rave Documentation
Jump to: navigation, search

Introduction

Getting tick marks to work correctly in Rave was hard. MATLAB offers NO way to get the handles of axes tick labels, so when Rave needs to do something special it has to create tick labels from scratch as text objects.

Axis tick marks must be set in one of three ways:

  • For normal numerical tick mark labels, you can use the normal MATLAB axes command x/y/ztick x/y/zticklabel properties.
  • If the graph can (ever) display text variables such that the tick labels need to be text strings, call the function "ravemaketextticks" near the end of the ravecreateKEYWORD.m file. This function will create text object tick labels that smartly wrap/rotate. Non-text tick labels will use MATLAB's default way of making tick labels.
  • If the graph needs custom tick labels (i.e. anything not covered by the first two bullets), call the function "ravemakecustomticks". Note that ravemaketextticks is essentially just a wrapper for ravemakecustomticks that automaticates the proper syntax. When you need more flexibility, use ravemakecustomticks.

Tick Label Sizing/Text Wrapping

Tick labels are drawn in the font and fontsize in raveprefs.fonts.graphname and raveprefs.fonts.graphsize. When these properties are changed via the setup tab (raveeditthemefontsgui), the function characterwidths is called. This function attempts to determine how many pixels each keyboard character will occupy on screen, and stores this info in raveprefs.fonts.graphwidth. (Non-keyboard ASCII characters are treated as 1 pixel. The characterwidths function could easily be modified to include other ASCII characters if needed.)

Tick label wrapping is really only an issue for the x-axis, since y-axis text is stacked vertically so the labels never interfere with each other. The function ravemovecustomticks is called by raveresizeaxes to move tick labels as a graph is moved/resized and to wrap text tick labels when necessary/possible. The function betterlinewrap determines if the ticklabel should be wrapped by comparing the available on-screen pixels (i.e. the distance between tick marks) to the estimated width of the ticklabel. If the width>available space, the string will be wrapped after a space or any of the characters +-/*})],_ or before the characters {([. If the string cannot be sufficiently wrapped (for example because it is one long word with no spaces or if even after wrapping it is still too wide) then ALL ticklabels for that axis will be rotated so the text reads vertically.

Tick Mark Locations

Tick Mark and Resizing Functions

The following functions are involved in making tick marks and resizing them when a graph is resized:

  • ravemaketextticks - This function is called by ravecreate<keyword>, usually near the end of the file. Based on the variable displayed on each axis and its datatype, this function decides what strings to use for tick marks and where to place tick marks default matlab tick mark system or to create text ticks using ravemakecustomticks.
  • ravemakecustomticks - This function makes text object tick labels with the strings sent to it by ravemaketextticks. Its main purpose is to create the text objects with the proper strings. This function does NOT handle string wrapping or rotation. This function also does not place the tick marks at their proper locations.
  • raveresizeaxes - Called in response to a graph changing size, this function resizes handles.allgraphs(ai) to fit inside handles.allblockers(ai) while leaving sufficient room for all axes/tick labels etc.
  • ravearrangeobjects - Called by raveresizeaxes (at the end), this function places all visual elements relative to handles.allgraphs(ai)
  • ravemovecustomticks - Called by ravearrangeobjects (at the end), This function determines if tick labels need to be wrapped or rotated, and puts them at the proper x/y/z locations in axes coordinates.
  • betterlinewrap - This function attempts to wrap a string by making an educated guess at how many pixels it will render to on screen. Called by ravemovecustomticks
  • raveniceticks - (Currently Unused) Calculates tick mark locations for a graph, similar to MATLAB's automatic xtick/ytick/ztick mode.
  • axeschangelistener -
  • raveupdateticksKEYWORD - This function is called by axeschangelistener whenever the ticks of graph change in response to zooming, changing axis limits, or resizing
  • ravesynchaxes - Called by ravearrangeobjects for 3d graphs.

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