Re: tall SURFACE plots don't work? [message #30221] |
Tue, 16 April 2002 07:09 |
Malcolm Walters
Messages: 8 Registered: October 2001
|
Junior Member |
|
|
"RichardW" <rmw092001@yahoo.com> wrote in message
news:9f4a7077.0204152342.313f761e@posting.google.com...
> Hello,
>
> I need to make a 3-d SURFACE type plot, with the z axis twice the
> length of the x and y axes (sort of skyscraper shaped). This ought to
> be extremely simple??? -
<Snip>
> The 'squashed' z axis works fine, but IDL doesn't allow the last
> example? - or maybe I haven't understood how POSITION keyword works in
> 3 dimensions???
> Thanks for any help,
>
> RW
>
> IDL5.5 Solaris
The real problem here is that the 3D position variable is not easily
converted into a 2D variable when plotting. For plot,contour etc this
variable contains the window position to draw into. Hence [0.2,0.2,0.8,0.8]
would give data centered in a plot but with a margin of 20% all round.
When moving to the 3d case this no longer applies. The position tries to
define both the on screen size but also the lengths of the axis. As you
rotate a surface around you will find that it doesn't fit into the size of
the box you asked for. I have posted some code below and if you run it with
a value of 0 then the plots each take up 10% of the width as expected. If
you change this to 45 or 90 then the behaviour becomes harder to understand.
Note also that the left hand surface gets squashed in, and isn't shown
correctly.
Malcolm Walters
pro surface_position_test,angle
;Draw some tick marks to allow us to see what is happening
plot,[0,1],[0,1],position=[0.0,0.0,1.0,1.0],/nodata,$
xticks=10,yticks=10,xticklayout=2,xminor=1,yminor=1
x=findgen(10)
y=findgen(20)
z=sin(x#y/20)
for i=0,4 do begin
surface,z,x,y,position=[i/5.0,0.1,(i/5.0)+0.1,0.9,0.0,1.0], $
ax=45,az=angle,/noerase
endfor
end
|
|
|