Le 03/04/2009 à 19:00, Hezekiah M. Carty a écrit :
> 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!
> 
Thanks for the tips and the code.

Maybe this kind of "utilities" should go somewhere in the wiki or in
a toolbox_simple ?

I found the example on the site useful, but a bit difficult for starting,
as they contain many things and its hard to know what are the minimum
required instructions to draw something (eg plend1 or plend).

Alain


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

Reply via email to