[Thread Prev][Thread Next][Index]

Re: legend script



Hello,

I attacked this kind of problem some months ago. I wanted to plot the legend where I wanted, how I wanted, with the color I wanted.
Herewith you will find the script I finally made (adapted from the one proposed in the Ferret distribution).
It works for both user and no user dimensions, but only for Ferret version previous to 5.53 (it does NOT work with this latest one).

I usually call this legend script after the plot is made, like this :

GO legend 0.25, 0.40, 5.70, 2, 0.10, "@P1legendtext"

It will draw a line from (x=0.25, y=5.70) to (x=0.25+0.40, y=5.70) (in no user units => does not change all the time according to the axes dimensions). So, it is at 5.70 vertically, starts at 0.25 horizontally and last 0.40 horizontally.
The line color will be red (because of the '2' value).
The legend text will be in black (always) and have 0.10-height. I write it in red, because of commodity : if you want later to print your graph in black and white, all the colors lines (text included) will be replaced for example by black and white dashed line and the text ALSO, so that it is no more readable !

If you have any question, I will be glad to answer !

Emilie V.


Attachment: legend.jnl
Description: Binary data





Le mercredi, 10 dιc 2003, ΰ 17:43 Europe/Brussels, Hein Zelle a ιcrit :

I've finished a script to create a legend for a plot with multiple
lines or contours. It will draw a legend for each line in a specified
corner of the plot, with a sample line.

usage:

plot /set_up /nolabel var1, var2, var3
go legend 1 var1
go legend 2 var2
go legend 3 var3
ppl plot

or

plot /set_up /nolabel var1, var2, var3
go legend 1 var1 ur
go legend 2 var2 ur
go legend 3 var3 ur
ppl plot

where "ur" is the corner where you want the legend, ul is default.
The script has a few remaining drawbacks:

- will only work with plot/set_up, not with plot/overlay
- you can't skip lines
- when using bottom corners, legends are built up from bottom to top.

If anyone knows how to improve that, I'd be happy to hear from
them. Comments welcome.

Hein Zelle

-----------------------------------------------------------------<
Hein Zelle
Dept. of Oceographic Research
KNMI, The Netherlands
work: zelle@knmi.nl http://www.knmi.nl/~zelle
private: hein@icce.rug.nl http://www.icce.rug.nl/~hein
Phone: +31 (0)30 2206704
-----------------------------------------------------------------<
--------------------------------------------------------------
Zie ook/see also: http://www.knmi.nl/maildisclaimer.html
<legend.jnl><testlegend.jnl>
—————————————————————————————
Emilie VANVYVE
Physicist, PhD student in geophysics
Universitι catholique de Louvain (UCL)
Institut d'astronomie et de gιophysique G. Lemaξtre (ASTR)
Chemin du Cyclotron, 2
1348 Louvain-la-Neuve (Belgium)
Phone : +32-10-473300 -- Fax : +32-10-474722
E-mail : vanvyve@astr.ucl.ac.be -- Web : www.astr.ucl.ac.be
—————————————————————————————

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement