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 
Switch to threaded view of this topic Create a new topic Submit Reply
plot legends - pvwave [message #4859] Sat, 19 August 1995 00:00 Go to next message
Pearson J E is currently offline  Pearson J E
Messages: 7
Registered: August 1995
Junior Member
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 ??

Any help much appreciated, thanks!!


--
|Jonathan Pearson - Postgrad| Why Waste Time Learning? |
| Computer Science Dept. | When Ignorance Is Instantaneous! |
|University Of Essex,England| |
| Mail--jepear@essex.ac.uk | - Hobbes, from Calvin and Hobbes fame |
Re: plot legends - pvwave [message #4946 is a reply to message #4859] Tue, 22 August 1995 00:00 Go to previous messageGo to next message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <41al9g$4pb@hacgate2.hac.com>, rep2857@sbsun0010.sbrc.hac.com (Mike Schienle) writes:
> 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'
>

You can also use normalized coordinates with XYOUTS
xyouts, .8, .8, /normal, 'Legend'

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
Re: plot legends - pvwave [message #4950 is a reply to message #4859] Mon, 21 August 1995 00:00 Go to previous messageGo to next 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
Re: Plot legends [message #20333 is a reply to message #4859] Wed, 14 June 2000 00:00 Go to previous message
alenhart is currently offline  alenhart
Messages: 1
Registered: June 2000
Junior Member
Try Windt's library

http://mimas.astro.washington.edu/deutsch/idl/htmlhelp/libra ry08.html#LE
GEND


In article <3944EDA8.12F70BEC@mathstat.dal.ca>,
Simon de Vet <simon@mathstat.dal.ca> wrote:
> Can anyone reccomentd an easy way to add a legend to a postscript
based
> plot?
>
> Since this is such a fundamental thing to want to do, I presume this
is
> already automatic, or can be implemented easily... I've browsed
through
> the help, and through David's site, to no avail.
>
> Help! I can understand the meaning of my plots, but I doubt anyone
else
> could...
>
> Simon
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: Plot legends [message #20345 is a reply to message #4859] Mon, 12 June 2000 00:00 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
In article <3944EDA8.12F70BEC@mathstat.dal.ca>, Simon de Vet
<simon@mathstat.dal.ca> wrote:
> Can anyone reccomentd an easy way to add a legend to a
postscript based
> plot?
>
You might try Fred Knight's program legend.pro available at
http://idlastro.gsfc.nasa.gov/ftp/pro/plot/legend.pro

with the associated demo program legendtest.pro
http://idlastro.gsfc.nasa.gov/ftp/pro/plot/legendtest.pro

--Wayne Landsman landsman@mpb.gsfc.nasa.gov

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: "Unsupported X Windows visual" ALMOST!
Next Topic: Moving a Line

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

Current Time: Wed Oct 08 15:49:53 PDT 2025

Total time taken to generate the page: 0.00705 seconds