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

Home » Public Forums » archive » Re: xyouts character size to scale with the size of the plot window
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: xyouts character size to scale with the size of the plot window [message #19176] Mon, 06 March 2000 00:00 Go to previous message
Ralf Srama is currently offline  Ralf Srama
Messages: 2
Registered: December 1999
Junior Member
Kristian,

I think you need to know how many plots you have on
one page. You can access this by

a=!p.multi[1] ;i.e. 3 in your example
b=!p.multi[2] ;i.e. 7 in your example
c=a*b ;21
factor=0.01
xyouts,7,3,'STRING',/data,charsize=.7-factor*c ;results in a
;smaller character depending on your number of plots on
;the screen

You can now play with the factor for your needs.

Alternatively you could use the system variable !p.clip. It
contains the coordinates of the last plot on the device.
In the example below you have for the first plot the numbers
30 and 290. This is a difference of 260 for the x-size of
your last plot. This difference is constant for the following
plots (e.g. 329 and 589).



!P.CLIP

The device coordinates of the clipping window, a 6-element vector of the
form [(x0, y0, z0), (x1, y1, z1)], specifying two opposite corners of
the volume to be displayed. In the case of two-dimensional displays, the
Z coordinates can be omitted. Normally, the clipping window coordinates
are implicitly set by PLOT, CONTOUR, SHADE_SURF, and SURFACE to
correspond to the plot window. You may also manually set !P.CLIP if you
want to specify a different rectangular clipping window or if the
clipping coordinates have not yet been set in the current IDL session.

IDL> plot, indgen(200)
IDL> print,!p.clip
30 704 290 811 0 1000
IDL> plot,indgen(200)
IDL> print,!p.clip
329 704 589 811 0 1000


Ralf Srama




Kristian Kjaer wrote:
>
> I hope this is not a too FAQ:
>
> IDL> !p.multi=0
> IDL> plot,indgen(10)
> IDL> xyouts,7,3,'A string',/data,charsize=.7 ; Gives text reasonably
> sized for my purpose
> IDL> !p.multi=[0,3,7]
> IDL> plot,indgen(10)
> IDL> xyouts,7,3,'A string',/data,charsize=.7 ; Gives text which is too
> large for the window.
>
> How to get the xyouts character size to scale with the size of the plot
> window?
>
> Thanks for any help.
> Best regards, Kristian Kj�r

--
ralf.srama@mpi-hd.mpg.de Tel 49-6221 516 423 Fax 49-6221 516 324
Max-Planck-Institut fuer Kernphysik, Saupfercheckweg 1, 69117
Heidelberg, Germany
CDA-Homepage http://galileo.mpi-hd.mpg.de/cassini
Dust-Group http://galileo.mpi-hd.mpg.de
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Planet movements
Next Topic: Re: suggestions for grabbing license from home

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

Current Time: Wed Oct 08 16:07:19 PDT 2025

Total time taken to generate the page: 0.00611 seconds