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

Home » Public Forums » archive » plot legends - pvwave
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: plot legends - pvwave [message #4950 is a reply to message #4859] Mon, 21 August 1995 00:00 Go to previous messageGo to previous message
rep2857 is currently offline  rep2857
Messages: 28
Registered: December 1994
Junior Member
In article <414qlu$ts7@seralph9.essex.ac.uk>,
Pearson J E <jepear@essex.ac.uk> wrote:
> My query concerns the addition of legends on plots created by pvwave.
>
> As I understand it, the positioning of a legend can only be accomplished by
> using the XYOUTS function where x and y represent coordinates corresponding to
> the x and y axis of the plot. In my sistuation I have a 2D graph whose axis can
> vary significantly depending on choices made in the program. Therefore by using
> the XYOUTS function my words often can end up on top of each other or not even
> on the plot itself.
>
> Is there anyway of making the positioning of the legend independent of the x
> and
> y axis of the plot ??

Cc'd to jepear@essex.ac.uk

Sure. XYOUTS can position data anywhere (even off the drawing area as I
have inadvertently found out on several occasions). The key is to use
device coordinates rather than plot coordinates for positioning. The
!X.S and !Y.S variables return the normalized coordinates of the
scaling factors used in positioning the plot frame. The upper right
coordinate of the plot frame can be determined with the following
commands:

xoff = !D.X_VSize * (!X.S(0) + !X.S(1) * !X.CRange(1))
yoff = !D.Y_VSize * (!Y.S(0) + !Y.S(1) * !Y.CRange(1))
xyouts, xoff, yoff, /device, 'Legend'

Add a little space in the X direction based on something like the
window dimensions and you have the starting coordinates for your
legend. Increment Y by some value say !D.Y_Ch_Size * 1.1 or whatever
seems to be appropriate for additional legend titles.

Mike Schienle Hughes Santa Barbara Research Center
Home: mgs@seldon.terminus.com Work: rep2857@sbsun0010.sbrc.hac.com
Contract Employee - Will visualize data for large amounts of money
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: "Unsupported X Windows visual" ALMOST!
Next Topic: Moving a Line

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

Current Time: Sat Oct 11 13:09:58 PDT 2025

Total time taken to generate the page: 0.24138 seconds