<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=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Monospaced;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Pr\00E9format\00E9 HTML Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PrformatHTMLCar
        {mso-style-name:"Pr\00E9format\00E9 HTML Car";
        mso-style-priority:99;
        mso-style-link:"Pr\00E9format\00E9 HTML";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></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 lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>Hello,<o:p></o:p></span></i></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'> For graphic window with a large number of curves, the problem is in displaying legends: using the legend function, the last entries are not visible.</span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>The solution I am trying to code is the following:<o:p></o:p></span></i></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'> First split the legends in 2 columns with approximately the same number of entries for each column. </span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>After placing the first column on the graphics, automatically place the 2nd column side by side with the first one,</span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>i.e. at a position which depends on the length of the strings in the first column, using move.</span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>xstringl gives the length of one of the legends: PROBLEM = it is approximate and most probably not the easiest way... </span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>40</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>names_legend</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>'legend_'</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>+</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#32B9B9'>string</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#FFAA00'>:</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#32B9B9'>round</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>/</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>2</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'> <i><span style='color:#01A801'>//nc is the number of curves: split in 2</span></i><o:p></o:p></span></p><p class=MsoNormal><u><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#AE5CB0'>legends</span></u><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>names_legend</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#FFAA00'>:</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>,</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#FFAA00'>:</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc1,font_size</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>3</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>,opt</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>"ul"</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>// put first column of legends</span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>a1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><u><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#AE5CB0'>gca</span></u><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>()</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;<o:p></o:p></span></p><p class=MsoNormal><i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#01A801'>// Get the width of the text</span></i><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>tw</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>0</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#A020F0'>for</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'> <span style='color:black'>i</span><span style='color:#5C5C5C'>=</span><span style='color:rosybrown'>1</span><span style='color:#FFAA00'>:</span><span style='color:black'>nc,</span> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'>                    <span style='color:black'>tl</span><span style='color:#5C5C5C'>=</span><u><span style='color:#AE5CB0'>xstringl</span></u><span style='color:#4A55DB'>(</span><span style='color:rosybrown'>0</span><span style='color:black'>,</span><span style='color:rosybrown'>0</span><span style='color:black'>,names_legend</span><span style='color:#4A55DB'>(</span><span style='color:black'>i</span><span style='color:#4A55DB'>)</span><span style='color:black'>,</span><span style='color:rosybrown'>a1.font_style</span><span style='color:black'>,</span><span style='color:rosybrown'>a1.font_size</span><span style='color:#4A55DB'>)</span><span style='color:black'>;</span> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'>                    <span style='color:black'>tw</span><span style='color:#5C5C5C'>=</span><span style='color:#32B9B9'>max</span><span style='color:#4A55DB'>(</span><span style='color:black'>tw,tl</span><span style='color:#4A55DB'>(</span><span style='color:rosybrown'>3</span><span style='color:#4A55DB'>))</span><span style='color:black'>;<o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#A020F0'>end</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;<o:p></o:p></span></p><p class=MsoNormal><u><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#AE5CB0'>legends</span></u><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>names_legend</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>((</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>+</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#FFAA00'>:</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>,</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>+</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#FFAA00'>:</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>nc,font_size</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>3</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>,opt</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>=</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>"ul"</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'> <i><span style='color:#01A801'>// 2nd column on top of first</span></i><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#32B9B9'>move</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>a1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>.</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#AAAAAA'>children</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>(</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>1</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>)</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>,</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>[</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>tw</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>*</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>0.7513907</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#5C5C5C'>+</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>0.0585762</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>,</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:rosybrown'>0</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:#4A55DB'>])</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif";color:black'>;</span><span lang=EN-GB style='font-size:9.5pt;font-family:"Monospaced","serif"'> <i><span style='color:#01A801'>//Move it horizontally (along x-axis);</span></i><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>As a matter of fact, I don’t know why I need to apply some linear relationship between tw and the value of the horizontal shift... This is awkward! I am unable to find an easy way to get the width of the box of the first column of the legend. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Thank you for any help.<o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Denis<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>