axis scaling in surf(x,y,z)

Bob Odom odom at apl.washington.edu
Fri Feb 13 19:28:48 CST 2009


On Fri, 13 Feb 2009, Ben Abbott wrote:

>
> On Feb 12, 2009, at 8:32 PM, Bobatapl wrote:
>
>> I would like to be able to independently scale the 3 axes in surf(x,y,z). 
>> It
>> looks like what I need is 'dataaspectratio', which only seems to work for 
>> 2D
>> not 3D plots. Is there a way to scale the axes, that I am missing, or a 
>> work
>> around?
>> 
>> I am using octave-3.0.2-1.1 with gnuplot-4.2.0-72.1 on 64bit SUSE Linux
>> 10.2.
>> 
>> Bob
>
> Bob,
>
> I think I understand what you're looking for.  Can you confirm that "daspect" 
> would do what you want?
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/daspect.html&http://www.google.com/search?client=safari&rls=en-us&q=daspect&ie=UTF-8&oe=UTF-8
>
> In the meantime, does xlim(), ylim(), zlim() not provide the functionality 
> you're looking for?
>
> Ben

Ben,

Yes, 'daspect' does exactly what I want to do. However it does not seem
to be part of octave, or at least the octave-3.0.2-1.1 I am running. I
just get the error message:
error: `daspect' undefined near line 34 column 1

xlim() etc. work as expected, but the relative lengths of the x,y,z axes are
auto-scaled based on some algorithm that apparently is out of user
control. The result is that surf() produces a plot scaled as the upper
figure in the link above, whereby 'daspect' returns 4 1 1. 
To produce a figure like the lower one, seems to require a functioning
'daspect'.

The 3.0.2 octave manual explicitly states that 'dataaspectratio' is a 2-element
vector, not a 3-element vecor, which is what is needed for surf().

Bob


More information about the Help-octave mailing list