<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1904289566;
        mso-list-type:hybrid;
        mso-list-template-ids:-887322218 67895313 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:2088728370;
        mso-list-template-ids:-16603706;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=FR link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:windowtext'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Samuel’s « legends_mc » is a very nice instruction.<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>It does exactly what  I wanted<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>               xLeg=0.;<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>               yLeg=1.04;<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>                                                           Xlegend=["CVitesse";"Vitesse";"Vannage";"Débit";"Chute";"Puissance"]                                                            <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>                                                           legends_mc(Xlegend, Lpc=-10, framed?=%f, pos=[xLeg yLeg])<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><img width=521 height=69 style='width:5.425in;height:.7166in' id="Image_x0020_2" src="cid:image001.jpg@01D5C7B1.B48854F0"><span style='color:windowtext'><o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Other case<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>                                                           Xlegend=["Cons.Vitesse";'Vitesse filtrée';"Dérivée";"Intégrale";"Lim. Ouverture";"Cons. Vannage CVA";"Cons. charge CC"]                              <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>                                                           legends_mc(Xlegend, Lpc=2, framed?=%f, pos=[xLeg yLeg])<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><img width=514 height=68 style='width:5.35in;height:.7083in' id="Image_x0020_3" src="cid:image003.jpg@01D5C7B1.B48854F0"><span style='color:windowtext'> :<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Best regard<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Pierre P.<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='color:windowtext;mso-fareast-language:FR'>De :</span></b><span style='color:windowtext;mso-fareast-language:FR'> users <users-bounces@lists.scilab.org> <b>De la part de</b> Samuel Gougeon<br><b>Envoyé :</b> mercredi 8 janvier 2020 20:13<br><b>À :</b> users@lists.scilab.org<br><b>Objet :</b> Re: [Scilab-users] About legend instruction in graphics<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hello,<span style='mso-fareast-language:FR'><o:p></o:p></span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Le 08/01/2020 à 19:30, Perrichon a écrit :<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>When drawing scope X(t) with multiple chanels, is there a way to get a horizontal legend to maximalize the graphic area (as matlab does)<o:p></o:p></p><p class=MsoNormal>All proposal for the legend positionning reduce the graphic area (vertical display with box or no box)<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><ol style='margin-top:0cm' start=1 type=1><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo3'>Legend are into the graphic. Some curves are not visible<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo3'>Legend are out of graphic, but reduces the graphic area.<o:p></o:p></li></ol><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Best Regards<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Pierre P.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p></blockquote><p><o:p> </o:p></p><div><p class=MsoNormal><span style='mso-fareast-language:FR'>legend_mc() aims to do that: <a href="https://fileexchange.scilab.org/toolboxes/274000">https://fileexchange.scilab.org/toolboxes/274000</a><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='mso-fareast-language:FR'><o:p> </o:p></span></p></div><p style='margin-bottom:12.0pt'><tt><span style='font-size:10.0pt'>--> legends_mc</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>function [] = legends_mc(Texts,Styles,Lpc,font_size,thickness,pos,framed?)</tt><br><tt> For many curves & related legends, displays a multicolumn bloc of legends:</tt><br><tt>  - The shape of the bloc can be specified (Lpc)</tt><br><tt>  - Positionning with Logarithmic or/and reversed axes is supported</tt><br><tt>  - Lines styles and Markers styles are supported and can be mixed.</tt><br><tt>    A set of polyline handles or having polyline children can be</tt><br><tt>    alternatively provided</tt><br><tt>  - Lines thickness(es) can be specified (ignored if handles are </tt><br><tt>    given: read out from the polylines properties)</tt><br><br><tt> HELP: run legends_mc() without any parameter</tt><br><tt> DEMO: run legends_mc(..) without specifying Texts</tt><br><br><tt> Texts  : vector of legends</tt><br><tt> Styles : a) vector of related lines or markers styles (integer indices)</tt><br><tt>          Styles(i)>0 -> line color (only solid style supported)</tt><br><tt>          -14<= Styles(i) <=0 -> marker (overlay with line unsupported)</tt><br><tt>         b) (2,n) matrix: </tt><br><tt>             Styles(1,:) = as in a)</tt><br><tt>             Styles(2,:) = line style, or color of marker</tt><br><tt>         c) vector of graphical handles. Then all Polyline children</tt><br><tt>            are searched (in chronological order of creation).</tt><br><tt>            Texts must have as many entries as there are available</tt><br><tt>            polylines.</tt><br><tt>            If only 1 handle is given and is an axes, the legends is </tt><br><tt>            set in this axes. When returning, the focus is restored </tt><br><tt>            to the axes priorly active.</tt><br><tt>            If a set of handles or an handle not being an axes is given,</tt><br><tt>            the legends are set in the currently active axes.</tt><br><tt>         Default Styles : gca()</tt><br><tt> Lpc>0 :  (maximal) number of Lines Per Column (integer)</tt><br><tt> Lpc<0 : -(maximal) number of Columns per line (integer)</tt><br><tt> framed? : boolean: if %T, draws the global box of legends (default)</tt><br><tt> pos : position of the block:</tt><br><tt>      "ur" | 1 : in the upper right corner (default)</tt><br><tt>      "ul" | 2 : in the upper left corner</tt><br><tt>      "ll" | 3 : in the lower left corner</tt><br><tt>      "lr" | 4 : in the lower right corner</tt><br><tt>      "?"  | 5 : interactive positionning with the mouse</tt><br><tt>      [xr,yr]: relative coordinates 0 <= xr,yr <= 1 of the upper left </tt><br><tt>         corner of the block, with respect to the upper left corner</tt><br><tt>         of the data bounds area. [0,0] is equivalent to "ul"</tt><br><tt> thickness: scalar or vector of lines thickness. </tt><br><tt>            If a vector is provided, its length must = Styles one.</tt><br><tt>            If styles are from handles, thickness vector is ignored.</tt><br><tt> </tt><br><tt> DEMOS: run legends_mc(..) without Texts of legends:</tt><br><tt>   clf, legends_mc( framed?=%f )</tt><br><tt>   clf, legends_mc( Lpc=7, pos="?" )</tt><br><tt>   clf, legends_mc( Lpc=-3, pos="lr" )</tt><br><tt>   clf, legends_mc( Lpc=-2, pos=[0.15 0.3] )</tt><br><tt>   clf, legends_mc( font_size=2, pos="ll" )</tt><br><tt>   clf, legends_mc( pos="?", thickness=2 )</tt><br><tt>   clf, legends_mc( pos="lr", thickness=1+round(rand(1:19)) )</tt><br><tt>   clf, plot2d(), legends_mc( Lpc=-3, pos="ll" )</tt><br><tt>   clf, plot(), f=gcf(); legends_mc(Styles=f.children($), pos="?")</tt><br><br><tt> EXAMPLE: </tt><br><tt>   clf, plot2d(), legends_mc("line #"+string(1:3), Lpc=-3, pos="?" )</tt></span><o:p></o:p></p></div></body></html>