help-octave
[Top][All Lists]
Advanced

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

Re: axis equal help!


From: Ben Abbott
Subject: Re: axis equal help!
Date: Wed, 05 Aug 2009 20:04:44 -0400

On Aug 5, 2009, at 7:40 PM, pvfloripa wrote:

Hi Everybody,

I am trying to plot a 3-D plot from several points. However, when I use the
"axis equal" command, only the X and Y axis are set to the same scale,
whereas Z doesn't change, making the plot look wrong. Is there any way
around this?

The same code works fine in Matlab.

Many thanks!

Paulo

Something like the following should work ...

figure (1)
clf
surf (peaks)
axis auto
xl = get (gca, "xlim");
yl = get (gca, "ylim");
zl = get (gca, "zlim");
span = max ([diff(xl), diff(yl), diff(zl)]);
xlim (mean (xl) + span*[-0.5, 0.5])
ylim (mean (yl) + span*[-0.5, 0.5])
zlim (mean (zl) + span*[-0.5, 0.5])

Ben



reply via email to

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