Axis properties

 

 

 

Xlim

plt(...,'Xlim',[xmin xmax]);
Specifies the x-axis limits. If you are using a 2 column subplot, you can specify the x-limits for both both columns by using a cell array. i.e. 'Xlim',{[xminL xmaxL] [xminR xmaxR]}  If you want to specify just the right column limits, replace the left column limits with the string 'default' .
 

Ylim

plt(...,'Ylim',[ymin ymax]);
Specifies the y-axis limits for the left-hand y axis of the main plot. Alternatively you may specify the limits for the main plot left and right hand y-axes using a cell array input as in: 'Ylim',{[ymin ymax] [yminR ymaxR]}. The 'Right' parameter should also be included in this case, however if you don't, plt will default to placing the last trace on the right hand axis. Note that this 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').
 

YlimR

plt(...,'YlimR',[ymin ymax]);
Although this is most often done with the Ylim parameter (above) you may also specify the limits for right-hand y axis using the YlimR parameter. The 'Right' parameter should also be included in this case, however if you don't, plt will default to placing the last trace on the right hand axis.
 

AxisPos

plt(...,'AxisPos',p);
p is a 4 element vector that modifies the size and position of the plot axis in the figure window. The first two elements modify the x and y coordinates of the lower left corner of the axis. The last two elements modify the axis width and height respectively. For example if p = [1 1 .9 1], the width of the plot will shrink by 10%. If p = [1 2 1 .8] then the space between the bottom of the figure window and the bottom of the x-axis will double and the plot height will shrink by 20%. Changing the size and position of the axis is often useful when building applications to make room for additional GUI objects. If p is a 5 element vector, the width of the trace ID box is increased by a factor of p(5) to allow longer trace names. If p is an 8 element vector, the position of the trace ID box (xLeft,yBottom,width,height) is multiplied by last four elements of p (i.e. p(5:8))
 

NewLimit
axisCB   

plt(...,'NewLimit',s);
plt(...,'axisCB',s);
Evaluate string s when either the x or y-axis limits are changed. These two terms (NewLimit and axisCB) are synonymous. This callback function can be overwritten by the cursor command plt('cursor',cid,'set','axisCB',fcn) which is described in more detail in the cursor commands section. In addition to a string, s may also be a function handle of the form @func or {@func,arg1,arg2,...,argn}. Note that the string substitutions can't be used with the function handle form of this parameter.
 

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]);
       ENAx or ENAy = 0 to disable metric prefixes on the x/y axis.
       ENAx or ENAy = 1 to enable metric prefixes on the x/y axis (default).
When metric prefixes are enabled plt will choose the best unit for the respective axis. As an example, suppose the x-axis label is 'seconds' and the x-axis data is [0 1 2 3 4 5]*1e-8. With metric prefixes disabled, the x-axis tick-labels and cursor readout will be in scientific notation. With metric prefixes enabled, the x-axis label will change to "nano-seconds" and scientific notation will no longer be required making the graph and cursors far more readable. (Note: metric prefixes are not used on the right hand axis).
 

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
-AxisProp
<LabelProp
>LabelProp
.LabelProp

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
To create a single column of plots (all using the same x axis), the subplot argument consists of n positive numbers, where n is the number of plots desired. Each number specifies the percent of the area to be occupied by each plot (starting from the bottom). Normally the sum of the array should be 100, although if the sum is less than 100, there will be some unused space at the top of the figure. For example, 'SubPlot',[40 30 15 15] tells plt to create four plots. The bottom one (the "main" plot) will us up 40% of the available height. The plot above that will use 30% of the height, and the remaining two will take 15% each. Each subplot except the main (lower) plot is assigned a single trace, with the last trace defined appearing in the upper most axis, the second to last trace appearing in the axis below that, etc. For example, the command plt(1:50,rand(7,50),'SubPlot',[40 30 15 15]) will create 7 random traces, with the first four traces displayed on the main (lower) plot (with a traceID box containing four labels) and the last 3 traces are displayed in the other three subplots. The example script demo\subplt.m demonstrates the use of single column subplots. Usually only the main plot may contain multiple traces, although the example script demo\weight.m shows a trick to get around this limitation for single column plots.

Dual column
The example script demo\subplt8.m demonstrates the use of dual column subplots. To create two columns of plots, insert a negative number into the subplot argument. The number of entries to the left of the negative number indicates how many plots will appear in the left column, and likewise, the number of entries to the right of the negative number indicates the number of plots in the right column. The negative number itself specifies the width (in percent) of the left column. Some examples will help clarify (assume y = [a b c d e f] where a,b,c... are column vectors):

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