comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Problem with axis scaling and position when plotting 3D data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problem with axis scaling and position when plotting 3D data [message #81316 is a reply to message #81307] Fri, 07 September 2012 05:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
rafdedier@gmail.com writes:

>
> Hi!
>
> I am having a problem with the axis scaling and position using the AXIS and PLOTS procedure for plotting data in three dimensions.
>
> I have written a test program that demonstrates the problem that is occurring:
>
> PRO TESTPLOT3D
>
> ; Create the random data.
>
> xdata = [0,2,2,0,0,2,2,0,2,0]
> ydata = [0,0,1,1,0,0,1,1,0.5,0.5]
> zdata = [0,0,0,0,2,2,2,2,3,3]
>
> xrange = [0, 3]
> yrange = [0, 1]
> zrange = [0, 3]
> anglex = 30
> anglez = 30
>
> WINDOW, XSIZE = 800, YSIZE = 800
>
> ; Set up the transformation matrix
>
> scale3, xrange = xrange, yrange = yrange, zrange = zrange, $
> ax = anglex, az = anglez
>
> ; Plot the data using plots
> plots, xdata, ydata, zdata, /t3d, psym = 6, color = 255, symsize = 5
>
> axis, xax = 0, /t3d, /data, xrange = xrange, CHARSIZE = 4, xtitle = 'X'
> axis, yax = 0, /t3d, /data, yrange = yrange, CHARSIZE = 4, ytitle = 'Y'
> axis, zax = 2, /t3d, /data, zrange = zrange, CHARSIZE = 4, ztitle = 'Z'
>
>
> END
>
> The file creates a set of x,y,z-datapoints and plots them in three dimensions using the SCALE3- and PLOTS-procedures. I want to add axes (using AXIS) onto the plot, but for some reason, the scaling and the position of the axes is incorrect for the x- and y-axis (and not for the z-axis), as the axes do not fully surround the datapoints. Some datapoints lie outside the axes??
>
>
> Can you see them problem that is occurring?

I see the axes all piled up in a heap at the very bottom
of window, with the data points scattered everywhere. I
have to admit, I don't immediately understand why.

I also have to admit I've never used Scale3 for this
purpose. I would have set the axes up and drawn the data
like this:

; Set the axes up.
surface, dist(20), xrange=xrange, yrange=yrange, zrange=zrange, $
charsize=4, xtitle='X', ytitle='Y', ztitle='Z', /NoData, /Save, $
ax=anglex, az=anglez

; Plot the data using plots
plots, xdata, ydata, zdata, /t3d, psym = 6, color = 255, symsize = 5

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: PLOT() function THICK keyword in v8.2 just a guideline?
Next Topic: Re: Parrallel Matrix Inversion in IDL?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:11:08 PDT 2025

Total time taken to generate the page: 0.00472 seconds