On Fri, Apr 3, 2009 at 1:45 AM, Alain Baeckeroot
<alain.baecker...@laposte.net> wrote:
> Hello
>
> I'm usng plplot since several days, and i need to plot several lines
> on one graph (lets say one dotted red, one thick green, one dashed blue).
> Is there a function to display the legend showing colored line (with
> proper style) and a text :
>  --- (blue)   "Var 1"
>  ... (red)    "Var 2"
>  === (green)  "Var 3"
>
> or do i need to build it by myself ?
>
> Alain.

Alain,

There is not a legend function in the core library.  If you do write
something for this, plgchr (get character height) may be useful for
scaling the spacing between legend entries.

The attached file has a simple if naively implemented legend function
I wrote some time ago using the OCaml PLplot bindings.
"character_height_wc" gets the text height in plot-world coordinates
and "draw_legend" draws the legend.  It may be useful if you wish to
write your own.

Best of luck!

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

Attachment: legend.ml
Description: Binary data

------------------------------------------------------------------------------
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to