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

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

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

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

Axes Tick Marks and Labels

From Rave Documentation
Revision as of 18:31, 25 April 2012 by Matt (Talk | contribs) (Introduction)

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


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