FreeMat
|
Section: Handle-Based Graphics
There are several ways to use xlim
to adjust the X axis limits of a plot. The various syntaxes are
xlim xlim([lo,hi]) xlim('auto') xlim('manual') xlim('mode') xlim(handle,...)
The first form (without arguments), returns a 2-vector containing the current limits. The second form sets the limits on the plot to [lo,hi]
. The third and fourth form set the mode for the limit to auto
and manual
respectively. In auto
mode, FreeMat chooses the range for the axis automatically. The xlim('mode')
form returns the current mode for the axis (either 'auto'
or 'manual'
). Finally, you can specify the handle of an axis to manipulate instead of using the current one.
As an additional feature, you can now specify inf
for a limit, and FreeMat will take that limit from the automatic set. So, for example xlim([10,inf])
will set the minimum for the x axis, but use the automatic value for the maximum.
--> x = linspace(-1,1); --> y = sin(2*pi*x); --> plot(x,y,'r-'); --> xlim % what are the current limits? ans = -1 1
which results in
xlim
function
--> plot(x,y,'r-') --> xlim([-0.2,0.2])
which results in
--> plot(x,y,'r-'); --> xlim([0,inf])
which results in