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. 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'). |