help-octave
[Top][All Lists]
Advanced

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

Re: axis equal help!


From: John W. Eaton
Subject: Re: axis equal help!
Date: Wed, 5 Aug 2009 20:28:30 -0400

On  5-Aug-2009, Ben Abbott wrote:

| 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])

Does 3d plotting in gnuplot have a way to specify equal axes?  The
docs for the version I have (4.2.5) say that "set size ratio" has no
effect for 3d plots, and that's what we are currently using to get
equal axes.

jwe


reply via email to

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