<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@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";
mso-fareast-language:EN-US;}
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;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Arial","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@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"><span lang="EN-US" style="font-family:"Arial","sans-serif"">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">I noticed that saving graphs with legends was not reliable. Loading the graph in exactly the same environment results in a figure without readable legend. More specifically, the
legend is almost always stowed in the upper left corner of the window, with all its components stacked on top of each other.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">In addition, even if the legend is initially in the top axis level “Axis(1)”, after loading it appears in the tree in “Axis(2)”, i.e. behind the graph. So that moving back the
legend to its original (X,Y) position does not allow to see it until gcf().children(1).filled=”off” is issued.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">Moving the legend using the “Axis properties” window is somehow possible by changing the “Data bounds” fields of the “Axis Options”, but it is hard to tell what is the effect of
the variable in each field. In addition, the units are not linked to anything relevant (always 0 for the first field and 0.001 for the second field ? same for X and Y). It looks like in general only the difference between the second field and the first field
matters.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">g_test=scf();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="ES" style="font-family:"Arial","sans-serif"">x=-1:0.01:1; y=sin(2*%pi*x); z=cos(2*%pi*x);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="ES" style="font-family:"Arial","sans-serif"">plot2d(x',[y;z]',style=1:2)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">legends(['Sin','Cos'],1:2,"ur")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">// Now, I save the figure in a file,
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">// clear it,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">// and load it again, to notice that the legend escaped from its original place, not being able to read it.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">// Legend recovery:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">g_test.children(1).filled="off";<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">// and then it may be necessary to play with the “Data Bounds” of Axis(2), X or Y (or both).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">I am using SciLab 6.0.0 (64 bits) on Windows 7 and a more recent version on Linux (64 bits), and both show this behavior. With SciLab 5.5.0 on Windows 7, after loading the figure,
the legend slips away as well, but it is still in Axis(1); thus, g_test.children(1).filled="off" is not necessary. And moving back the legend to its original position is achieved by setting the Data Bounds to 0 and 0.001 on both X and Y axes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">This behaviour looks so strange to me that I have spent a lot of time trying to figure out how to avoid it… without success.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif"">Denis
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";mso-fareast-language:FR">[@@ THALES GROUP INTERNAL @@]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Unité Mixte de Physique CNRS / THALES<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">1 Avenue Augustin Fresnel<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">91767 Palaiseau CEDEx - France<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Tel : +33 (0)1 69 41 58 52 Fax : +33 (0)1 69 41 58 78
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">e-mail : <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""> <a href="mailto:denis.crete@thalesgroup.com"><span style="color:blue">denis.crete@thalesgroup.com</span></a> <<a href="mailto:%20denis.crete@thalesgroup.com"><span style="color:blue">mailto:%20denis.crete@thalesgroup.com</span></a>><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><a href="http://www.trt.thalesgroup.com/ump-cnrs-thales"><span style="color:blue">http://www.trt.thalesgroup.com/ump-cnrs-thales</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""><a href="http://www.research.thalesgroup.com"><span style="color:blue">http://www.research.thalesgroup.com</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>