[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does IDL calculate the graph axis values?

In article <38986E90.5B2D58C8@ssec.wisc.edu>,
	"Liam E. Gumley" <Liam.Gumley@ssec.wisc.edu> writes:
> Declan Vogt wrote:
>> I'd like to find out what IDL will use as the max and min values for a
>> graph axis before it actually plots the axis. I've been doing this by
>> creating a window, drawing the axis, and reading !x.crange, then erasing
>> the window, but it's not very elegant, and it doesn't work for
>> postscript.
>> Does anyone know if there is an IDL routine I can call?
> I don't think there's a built-in routine for this purpose. However you can
> always use the Z buffer as a temporary graphics device:
> Say your data is defined as follows:
> x = findgen(200) * 0.1
> y = sin(x)
> First you save the current graphics setup:
> entry_device = !d.name
> entry_window = !d.window
> entry_config = {x:!x, y:!y, z:!z, map:!map}
> Then you create a temporary plot in the Z buffer:
> set_plot, 'Z'
> device, z_buffer=0
> plot, x, y, /nodata, xstyle=4, ystyle=4, /noerase, /ynozero
> xrange = !x.crange
> yrange = !y.crange

There is also the 'NULL' device to suppress 
graphics output entirely:

  dSave = !D.NAME 
  SET_PLOT, dSave


-bob mallozzi


Robert S. Mallozzi                                       256-544-0887
                                                      Mail Code SD 50
http://gammaray.msfc.nasa.gov/           Marshall Space Flight Center 
http://cspar.uah.edu/~mallozzir/                 Huntsville, AL 35812