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

Re: !x.region,!y.region




"R.Bauer" <R.Bauer@fz-juelich.de> writes:
> 
> this is my next question about the secrets of the plotarea
> (Direct Graphics)!
> 
> How are !x.region,!y.region are calculated?
> 
> It seems to me that's they are only define the plotregion if 
> !P.charsize eq 1.0.
> 
> If !p.charsize changes the region is not changing.
> 
> How did I calculate the region which my plot is using 
> from Y-Title to X-Title?

I have not had much use for !x.region and !y.region -- I can't recall
when they have worked for me.

I use !x.window and !y.window instead.  These change when you change
the character size.

Example:

IDL> plot, findgen(10)           
IDL> print, !x.window, !y.window
    0.0937550     0.971880
    0.0781300     0.960943
IDL> !p.charsize=2
IDL> plot, findgen(10)
IDL> print, !x.window, !y.window
     0.187505     0.943755
     0.156255     0.921880

However, I should make it clear that changing the character size alone
does not update ![xy].window.  These values are only reset when you
make a PLOT command.  If you do indeed need to know the plot
dimensions before making output, then you can use 

PLOT, XSTYLE=(xstyle OR 4), YSTYLE=(ystyle OR 4), /NODATA, ...

which doesn't make any output but does establish the new coordinate
system.

Cheers,
Craig


-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------