bug in 'axis'? [message #44552] |
Tue, 28 June 2005 12:57  |
Grant W. Petty
Messages: 2 Registered: June 2005
|
Junior Member |
|
|
I am using IDL (Version 5.4 (linux x86)) routines 'scale3', 'shade_volume',
'polyshade', and 'tvscl' to render and display a 3-D array. I am
subsequently using 'axis' to add cartesian axes to the rendered image.
Everything works fine, PROVIDED that there is a call to 'plot' somewhere
before the first call to 'axis'. It doesn't matter what I'm plotting or
how things are scaled, but if I comment out the call to plot, the later
'axis' call renders what appears to be an axis of zero length.
It's not clear to me why 'axis' should depend on a prior call to 'plot'.
Is there a system variable that needs to be initialized before the call to
'axis'? Can I do this without a 'plot' call?
Here is a stripped down program that illustrates the problem:
;----------------------------
ndim2 = 64
pixels = 256
window, 0, xsize=2*pixels, ysize=2*pixels
window, 1, xsize=2*pixels, ysize=2*pixels
depth=3.2
wset, 0
; when the following line is commented out, the axis call at the
; bottom does not give the expected result
;
; plot, [0.0,1.0], [0.0,1.0]
scale3, xrange=[0,63],yrange=[0,63],zrange=[0,63]
wset, 1
axis, ndim2, ndim2, 0, /T3D, charsize=2, zaxis = 1, zrange=[0, depth]
; ----------------------------
________________________________________
Prof. Grant W. Petty
Atmospheric and Oceanic Sciences
1225 W. Dayton Street
University of Wisconsin-Madison
Madison, WI 53706
gpetty@aos.wisc.edu
Tel: (608) 263-3265
Fax: (608) 262-0166
|
|
|
Re: bug in 'axis'? [message #44633 is a reply to message #44552] |
Wed, 29 June 2005 23:16  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Grant W. Petty wrote:
>
> I am using IDL (Version 5.4 (linux x86)) routines 'scale3',
> 'shade_volume', 'polyshade', and 'tvscl' to render and display a 3-D
> array. I am subsequently using 'axis' to add cartesian axes to the
> rendered image.
>
> Everything works fine, PROVIDED that there is a call to 'plot' somewhere
> before the first call to 'axis'. It doesn't matter what I'm plotting or
> how things are scaled, but if I comment out the call to plot, the later
> 'axis' call renders what appears to be an axis of zero length.
>
> It's not clear to me why 'axis' should depend on a prior call to 'plot'.
> Is there a system variable that needs to be initialized before the call
> to 'axis'? Can I do this without a 'plot' call?
I don't know why this doesn't work, but clearly something
is not being set up that should be. I would replace your
SCALE3 command with this:
SURFACE, DIST(5), /NODATA, /SAVE, XRANGE=[0,63], $
YRANGE=[0,63], ZRANGE=[0,depth], XSTYLE=1, $
YSTYLE=1, ZSTYLE=1, CHARSIZE=1.5
Now you will have a 3D coordinate space and your AXIS command
will work appropriately.
Cheers,
David
|
|
|
Re: bug in 'axis'? [message #44640 is a reply to message #44552] |
Wed, 29 June 2005 07:46  |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
> I once noticed that if no plot has been made, the system variable
> !p.position=[0, 0, 0, 0]. That means that the plotting area is zero
> until something is plot.
>
You can create a plot with the /NODATA flag and set [XYZ]STYLE to 4
(suppress entire axis). The system variables dependent on the plot call
will be set, but no plot or axes will get drawn with the plot command.
Hope that helps.
-Mike
|
|
|
Re: bug in 'axis'? [message #44645 is a reply to message #44552] |
Wed, 29 June 2005 01:36  |
ph le sager
Messages: 5 Registered: June 2005
|
Junior Member |
|
|
The AXIS pro does not know where the coordinate [ndim2, ndim2, 0] is if
no plot has been made. The PLOT pro set up the coordinate system, and
is required (maybe with a /nodata and combination of xyzstyle).
I once noticed that if no plot has been made, the system variable
!p.position=[0, 0, 0, 0]. That means that the plotting area is zero
until something is plot.
|
|
|