<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Thanks Christophe:<br>
      <br>
      Le 30/03/2015 17:31, Dang, Christophe a écrit :<br>
    </div>
    <blockquote
cite="mid:AMSPR07MB2094EF497AB30491755EB76E5F50@AMSPR07MB209.eurprd07.prod.outlook.com"
      type="cite">
      <pre wrap="">Brought back to the list so everybody can contribute

--------------------------------------------------------------------------------
De : <a class="moz-txt-link-abbreviated" href="mailto:david.diruscio@libero.it">david.diruscio@libero.it</a> [<a class="moz-txt-link-freetext" href="mailto:david.diruscio@libero.it">mailto:david.diruscio@libero.it</a>]
Envoyé : lundi 30 mars 2015 15:50
À : Dang, Christophe
Objet : R: RE: [Scilab-users] Issue with graphic interface

Yes, I'm using a GUI that perform operations on data and then displays the curve related to the processed data on a 2D plot.
The steps are very simple:

1) Load data files
2) Perform some operations on the data
3) Display the results on a 2D plot

At this stage of the process everything is fine and well formatted (since I set the properties of the figure and of the axis)

Now, It is useful however to compare different curves obtained with different data.
So I just repeat steps 1),2) and 3) in order to have a second plot on a different figure. When I copy and paste one curve (with the legend properly
formatted) in the box of the other curve I have to update the legend (and this is fine, for example in Matlab I usually do so). In order to update the legend I do the following operations

4) right click on one curve
5) "insert legend"
6) type the name of the curve

The fact that I don't understand is why when I update the legend (after step
6) the box of the legend (that has been set to be "white" in each of the two
figures) becomes transparent so that you can see the grid passing through the legend and making the legend itself not very clear to read.

Thanks for your help
</pre>
    </blockquote>
    Here is the complete way to reproduce and identify the 2 bugs:<br>
    <pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(174,92,176);text-decoration:underline;">clf</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">subplot</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">plot2d</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">xgrid</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">legend</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">3</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">subplot</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">plot</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(92,92,92);">-</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">legend</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">xgrid</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(100,174,100);font-style:italic;">// the legend background is opaque. It clips the grid</span>
<span style="color:rgb(100,174,100);font-style:italic;">
// click right on the green curve above: select COPY</span>
<span style="color:rgb(100,174,100);font-style:italic;">// go to the bottom axes, and paste the curve</span>
<span style="color:rgb(100,174,100);font-style:italic;">// See the Legend handle:</span>
<span style="color:rgb(0,0,0);">ax</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(174,92,176);text-decoration:underline;">gca</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">ax</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">children</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(100,174,100);font-style:italic;">// It is 2nd position since the copied curve has been inserted afterwards (as children(1))</span>

<span style="color:rgb(100,174,100);font-style:italic;">// Then, to update the legend, still for the bottom axes, </span>
<span style="color:rgb(100,174,100);font-style:italic;">// - click right on the green curve: select Legends =</span><span style="color:rgb(100,174,100);font-style:italic;">></span><span style="color:rgb(100,174,100);font-style:italic;"> Insert, and type </span><span style="color:rgb(100,174,100);font-style:italic;">"</span><span style="color:rgb(100,174,100);font-style:italic;">Test</span><span style="color:rgb(100,174,100);font-style:italic;">"</span>
<span style="color:rgb(100,174,100);font-style:italic;">// =</span><span style="color:rgb(100,174,100);font-style:italic;">></span><span style="color:rgb(100,174,100);font-style:italic;"> Here, the legend</span><span style="color:rgb(100,174,100);font-style:italic;">'</span><span style="color:rgb(100,174,100);font-style:italic;">s background becomes transparent and lets the grid appearing.</span>
<span style="color:rgb(100,174,100);font-style:italic;">// Why? Look at the axes children:</span>
<span style="color:rgb(0,0,0);">ax</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">children</span>
<span style="color:rgb(100,174,100);font-style:italic;">// The legend block is now children(1), and its fill_mode is </span><span style="color:rgb(100,174,100);font-style:italic;">"</span><span style="color:rgb(100,174,100);font-style:italic;">off</span><span style="color:rgb(100,174,100);font-style:italic;">"</span><span style="color:rgb(100,174,100);font-style:italic;">.</span>


</pre>
    So: There are here 2 bugs:
    <br>
    a) the <span style="text-decoration: underline;">legends</span>
    handle should not change
    <br>
    b) the fill_mode should not be set to "off". By the way, the default
    is conveniently to "on". So it is not a default's issue.<br>
    <br>
    David, could you fill a bug report (i guess, only one)?<br>
    <br>
    Samuel<br>
    <br>
  </body>
</html>