plt HelpText on | Although the pseudo object is created with the above 'set' command, the individual text objects defined are not actually created until this on command is given. Most often this command is used to reenable the Help Text after it was turned off with the command shown below. |
plt HelpText plt HelpText off |
Both of these forms are equivalent. They delete the text objects created by the above on command. Often you will want the help text to disappear once the user starts using the plot so it doesn't get in the way. One way to do this is to include 'MoveCB','plt HelpText;' in the parameter list when you are creating the plt pseudo object. This sets the move cursor callback so that when you move the cursor or click on the plot, the help text will be removed. |
plt('HelpText','get') | This returns the v parameter that was used to create the HelpText object. There aren't many uses for this command, although one use would be to copy a HelpText object from one figure to another. |
plt('HelpText','text') | This returns a list of handles to text objects that were created after a helptext
'on' command has been executed. An empty list is returned
if the helptext object is currently off. Since Helptext is marked with a special user
value, an equivalent result is returned from the command
|
'abcdef' | Using a single string for the v parameter doesn't give the resulting HelpText object much utility beyond the underlying text object it creates but this is still sometimes useful because it is so easy to create along with the plt pseudo object. |
{'abcdef' -.1+.5i} | Usually you will use a cell array to define the help text which allows you to specify more parameters other than just the string. The only required parameter when using the cell array definition is the text object location which is specified by a complex number (the real part giving the horizontal position and the imaginary part giving the vertical position). In this example, the horizontal position is to the left of the main axis (by 10% of the plot) and the vertical position is at the middle of the main plot. If the location is not specified (by using a string argument as in the example above) the position used is .03+.96i |
{'abc' 'def' 'line3' .5+.96i 'color' 703050 'fontsize' 20} |
Each text string may be as many lines as you want (3 lines in this example). After the position
element, you may specify as many property value pairs as you need. Only text properties are
allowed. If the text color is not specified, the default color [1 .6 0] is used. The font size will
default to 12 if not specified. Note that for this form (as well as the following one below), the
position value (complex) is required. This helptext argument must be a row cell array. (A column
cell array will not produce the expected result.) Note that in this example, the color is defined
using one of plt's alternate forms (described in the
|
{'ab' 'cd' .5+.9i 'color' 'red' 2i 'line3' .1+.1i 2i 'line4' .9+.9i 'fontweight' 'bold'} |
With the full generality, you may define as many strings as you want, with each of these
strings being in different locations with different string properties. This example creates
three strings, the first of which is two lines. The "2i" (which occurs twice) in this example
is a separator that indicates a new string is about to be defined. Actually, any
complex number will serve the same purpose, but my habit is to always use "2i" for this
separator to make it easy to recognize. In this example, the first two help lines ('ab' & 'cd') will be red because the text is followed by the color specifier [1 0 0]. However the next two lines ('line3' & 'line4') have no color specifier, so they will be in the default color ([1 .6 0]). However, if you change the 2i that appears just before 'line3' to a -2i then line3 will also be red. This is because a delimiter with a negative imaginary component indicates that you want all the properties specified for the previous helptext line to apply to the current one as well. If you changed the next 2i to a -2i as well, then all the help lines defined will be red. If the same property is included both after the text string and in the carry-over property list (enabled by the negative imaginary component) then the property value after the text string takes priority. |
demo folder: | movbar, subplt, trigplt, vbar, wfalltst, xChart |
math folder: | airspeed, curves, gauss, gpsLog, hermite, julia |
sig folder: | afilt, editz, weight |