<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>legend</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="legend"> draw graph legend</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>hl=legend([h,] string1,string2, ... [,pos] [,boxed]) </CALLING_SEQUENCE_ITEM>
     <CALLING_SEQUENCE_ITEM>hl=legend([h,] strings [,pos] [,boxed]) </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>h</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: graphic handle on an Axes entity or vector of handles on
	    polyline  entities. The default value is the handle on <VERB>current_axes</VERB>.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>string1,string2, ...</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: character strings stringsi is the legend of the ith curve</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>strings</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: n vector of strings, strings(i) is the legend of the ith curve</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>pos</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: (optionnal) specify where to draw the legend; this parameter may be a integer
                flag (or equivalently a string flag) or a vector [x,y] which gives the coordinates 
                of the upper left corner of the legend box. In the first case the possible values
                are:</SP>
          <PARAM_INDENT>
            <PARAM_ITEM>
              <PARAM_NAME>1</PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP> the legend are drawn in the upper right-hand corner (default).</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>

            <PARAM_ITEM>
              <PARAM_NAME>2</PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP> the legend are drawn in the upper left-hand corner.</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>

            <PARAM_ITEM>
              <PARAM_NAME>3</PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP> the legend are drawn in the lower left-hand corner.</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>

            <PARAM_ITEM>
              <PARAM_NAME>4</PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP> the legend are drawn in the lower right-hand corner.</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>

            <PARAM_ITEM>
              <PARAM_NAME>5</PARAM_NAME>
              <PARAM_DESCRIPTION>
                <SP> interactive placement with the mouse .</SP>
              </PARAM_DESCRIPTION>
            </PARAM_ITEM>

          </PARAM_INDENT>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>boxed</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: a boolean (default value %t) which sets ot not the drawing of the box.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>hl</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: a handle, points to the Compound containing all the legend .</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    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: </P>
    <P> 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. </P>
   
    <P>
    In the interactive placement (opt=5) move the legend box with the
    mouse and press the left button to release it.</P>
    <P>
    This function allows more flexible placement of the legend than the
    leg plot2d argument.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
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);
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>plot2d</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>xstring</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>polyline_properties</LINK>
    </SEE_ALSO_ITEM>

  </SEE_ALSO>
</MAN>
