help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: matlab and octave


From: Miquel Cabanas
Subject: Re: matlab and octave
Date: Tue, 18 Nov 2003 14:38:34 +0100
User-agent: Mutt/1.3.28i

hi,

On Tue, Nov 18, 2003 at 12:17:25PM +0000, A. S. Budden wrote:
> 
> Also, I've found that the axis command doesn't seem to work very well in
> octave.  In my .m file I have a function plot_ab (at the end of this
> email).  The line ax=axis returns [-1.8131 1.3346 -0.9580 1.5246] in
> matlab and the plot virtually fills the window.  In octave, ax=axis
> returns [-10 10 -10 10] and the plot is only about 1/10 the size of the
> window.
> 

I'm not sure about Matlab, but axis (help axis, type axis) sets
by default the __current_axis__ variable to [-10,10,-10,10], and
then, unless you have chosen to set the axis manually, sets gnuplot
autoscale mode, that does a pretty good job at adjusting ranges,
and *unless* you have used axis() to manually set the axis, that
variable does not change and *does not* contain the real limits
set by gnuplot.

Also, according to the on-line help, axis() is not expected to return
any value, though it returns __current_axis__ at some point (couldn't
find where, could this be bug?). On the other side, gshow() does not
seem to be the way to go either, since `gshow xrange' returns [*:*]
whenever the axis range are handled by gnuplot.

Thus, if you want to set your axis manually, you will have to obtain
the x,y-limit values from your data, then calculate the axis limits,
and last use axis() to pass gnuplot the limits. Incidentally, the
file axis.m contains an example code about calculating "good axis
limits".

As for the replot() function, note that some functions might call it,
for instance, axis() does use it.

Miquel

-- 
Miquel E Cabanas ------------------------------------------------------
SeRMN, Universitat Autonoma de Barcelona (address@hidden)
------------------------------------------o-oo--ooo---ooo--oo-o--------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]