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?
Thank you in advance,
Kind regards,
Raf De Dier
|