Axis properties |
|
![]() |
Xlim |
plt(...,'Xlim',[xmin xmax]); |
Ylim |
plt(...,'Ylim',[ymin ymax]); |
YlimR |
plt(...,'YlimR',[ymin ymax]); |
AxisPos |
plt(...,'AxisPos',p); |
NewLimit
|
plt(...,'NewLimit',s); |
moveCB |
plt(...,'moveCB',s); Evaluate string s whenever the cursor is moved. This callback function can be overwritten by the the cursor command plt('cursor',cid,'set','moveCB',fcn) which is described in more detail in the cursor commands section. The moveCB is not really an axis property, but is included in this section because of the parallels with the above axisCB parameter. As with the axisCB parameter, you may use function handles for this parameter (see above). |
ENApre |
plt(...,'ENApre',[ENAx ENAy]); |
AxisLink |
plt(...,'AxisLink',m);
tells plt to start with the left/right axes linked if m=1 or unlinked
if m=0. For more details, see the
right hand
axis section. |
+AxisProp
|
If a property name is prefixed with a
+ or a - character then the property value will be
applied to the left or right hand axis
respectively.
If a property name is prefixed with a
> ,
< or a
. character then the property value will be
applied to the left hand axis label, right hand axis label, or x axis label
respectively. plt(...,'+Ycolor',[0 0 1],'-Yscale','Log'); In this example plt will assign the value [0 0 1] (blue) to the Ycolor property of the main (left hand) axis, and it will apply the value 'Log' to the Yscale property of the right hand axis. The plus and minus signs are called a property prefix characters and are required so that plt knows which axis you want to modify. plt(...,'>FontName','Lucida Handwriting'); In this example the font used for the right hand axis label is changed to Lucida Handwriting. More than one property prefix character may be included in front of a property name. For example: plt(...,'+<.FontSize',13); In this case, the font size for the left hand axis tick labels, the left y-label, and the x-label are increased to 13.
The example
demo\pub.m demonstrates the use of these prefix
characters.
Note that if a property name appears without one of these 5 leading prefix
characters (<>.+-), then property value will
be assigned to all the lines that have
been defined earlier in the argument list. |
SubPlot |
plt(...,'SubPlot',v);
Normally plt puts all the defined traces on a single plot (which may
have left and right hand y-axes) that fills most of the figure area. However
with the SubPlot parameter you can tell plt to create several plots in the
same figure. All the plots are arranged in either one or two columns. All
plots in a column must use the same x-axis. The subplot in the lower left
corner has a special designation (the main plot) since that is the only plot
that includes a traceID box. Also some of the cursoring features are only
available on the main plot (peak/valley finder, delta cursors, expansion
history, the Mark/Zout/LinX/LinY tags, and the x-axis slider. Each subplot
however has its own y-axis cursor readout. These cursor readouts are easy to
identify since its background color matches the trace and axis colors. The
full panning and zooming features of plt are supported for each subplot. When
any subplot is panned or zoomed in the x-axis, all the x-axis limits of all
the other subplots in the same column are set to match the newly chosen
values. Single column Dual column plt(x,y,'SubPlot',[100 -60 100],'Right',[2 3]); The subplot parameters tells plt to create two plots both of which fill the entire height available in the plotting area of the figure. The left (main) plot fills 60% of the width with the second plot filling the remaining 40%. Since six traces are defined, the first five traces (a thru e) appear on the main plot and the last trace (f) appears on the right plot. Since the TRACEid parameter was not included, the trace ID box next to the main plot will contain the default trace labels (Line1 thru Line5). To label the traces more informatively, a parameter such as 'TRACEid',{'a' 'b' 'c' 'd' 'e'} could be added to the plt argument list. Since the 'Right' parameter was included, the main plot will include both right and left axes, with the 2nd and 3rd traces (b and c) on the right and the remaining three traces (a,d,e) on the left. The left and right axes will be separated by enough space to leave room for the axis labels, and this space will be increased when the 'Right' parameter is used so that there is room for an axis label on the right side of the main (i.e. left) axis. However if you would like to increase or decrease the amount of space between the two columns you can do this by modifying the width argument. As an example, suppose as above you still want the left plot to occupy 60% of the available width, but you want to increase the spacing between the two axes by 2.3% of the figure window width. To do that you would use 'SubPlot',[100 -60.023 100]. And for another example, if you wanted to decrease the spacing by 3% of the figure width you would use 'SubPlot',[100 -60.97 100]. plt(x,y,'SubPlot',[50 30 20 -55 70 20]); Three plots will be created in the left column which fills 55% of the width of the plotting area. The main plot on the bottom (containing traces a & b) fills 50% of the height, the middle plot (trace c) fills 30% and the top plot (trace d) fills the remaining 20% of the height. Two plots are created in the right column which fills the remaining 45% of the width. The lower of these (trace e) fills 70% of the height, and the upper (trace f) fills 20%, with the upper 10% remaining blank. Note that both traces in the main plot use the left-hand axis since no 'Right' parameter was given and no limits or labels were specified for the right-hand axis. (With this many subplots it's best not to use a right-hand axis since it makes all the subplots significantly narrower to make room for the right-hand axis ticks and labels.)
plt(x,y,'LabelX',{'meters' 'pascals'},'Ylim'{[0 5] [0
.1]}); Even though the subplot argument is not included here, plt
will split the plot horizontally as if you had included
'SubPlot',[100 50 100]
in the argument list. This is because two different x-axis labels are
specified with the 'LabelX' parameter and the only time this is needed is
for two column subplots. The right column plot will contain trace f and the
left column (main) plot will contain traces a thru e. Since two y-axis
limits are specified, plt will put both left and right axes on the main
plot. In this example the 'Right' parameter is not included, so plt will
default to putting the last trace of the main plot (trace e) on the right
axis with the other four traces on the left axis. (Be careful not to confuse
the concepts of the right and left axes of the main plot, with the right and
left columns of subplots.) Also note that the 'Ylim' parameter only
specifies limits for the main plot and never for any of the other subplots.
If you need to set the y-axis limits for the other subplots, use the set
command with the axis handles obtained from getappdata(gcf,'axis'). |
SubTrace |
When using subplots, it is important to understand that the default behavior
is to allow only a single trace on each subplot except for the main axis
(lower left). The main reason for this is to allow plt to provide a simple
cursoring mechanism which allows every trace to be cursored. However there
are two situations where you may want to change this default behavior. The
first is where cursoring is disabled (usually because the plot is too be
used for publication instead of for data exploration). Since cursoring is
not an issue, there is no reason you must stick with the default behavior
for assigning the traces to the axes. The second plot in the script
demo\pub.m is an example of how the
SubTrace parameter might by used in this
situation. The second situation where you might want to use this parameter
is when you plan on modifying the cursor behavior to make sense for the
particular trace arrangement you have in mind. This requires a detailed
understanding of plt's cursoring commands, but is doable when the trace
configuration and desired cursoring scheme are reasonably simple.An example
of this second situation can be found in the script
demo\weight.m. There are two ways to use this parameter to assign the traces to the various subplots. For either method you must know how plt numbers the axes. Axis number one is always the main axis (lower left). Then axis two is the one directly above the main axis and axis three is the one above that, continuing to the top of the left column. Then the lowest axis of the second column (if it exists) is assigned to the next number, and continuing upwards as before. Finally after all the subplots have been assigned a number in this manner, the right hand axis of the main plot (if it exists) is assigned to the next higher integer. Suppose for example, you have 4 axes and 9 traces and that you want to put two traces on each of the first 3 axes and then put the remaining 3 traces on the last axis. You could do this with 'SubTrace',[2 2 2 3]. Instead of specifying how many traces are on each axis, an alternate way of doing this is to specify which axis each trace goes on. So an equivalent to the previous parameter you could use 'SubTrace',[1 1 2 2 3 3 4 4 4]. Of course this second method is always going to be longer than the first method, so you would likely only use if you needed to assign the traces to the axes in a different order, for example 'SubTrace',[1 2 3 1 2 3 4 4 4]. |