Man Scilab

legend
Scilab Function

legend - draw graph legend

Calling Sequence

hl=legend([h,] string1,string2, ... [,pos] [,boxed])
hl=legend([h,] strings [,pos] [,boxed])

Parameters

Description

Puts a legend on the current plot using the specified strings as labels. legend prepends labels by a recall of the corresponding line or patch. The recall is type ans properties are recover from the given handles:

when called without handle argument (or with a handle on a axes entity) the function looks first build the vectors of handle on polylines entities which are the children of the given axes.

In the interactive placement (opt=5) move the legend box with the mouse and press the left button to release it.

This function allows more flexible placement of the legend than the leg plot2d argument.

Examples


set figure_style new
t=0:0.1:2*%pi;
a=gca();a.data_bounds=[t(1) -1.8;t($) 1.8];

plot2d(t,[cos(t'),cos(2*t'),cos(3*t')],[-1,2 3]);  
e=gce();
e.children(1).thickness=3;
e.children(2).line_style=4;

hl=legend(['cos(t)';'cos(2*t)';'cos(3*t)'],a=1);
 
  

See Also

plot2d ,   xstring ,   polyline_properties ,  

Back