<div dir="ltr"><div>Federico...thanks for asking the question.</div><div>I was wondering about it myself for quite some time.</div><div>Once recognizing the fact, I just accepted that new entities are placed at the first position.</div><div>However, it might be interesting to get some insight of why it is like this....for now I guessed it has to do with how to handle memory.</div><div><br></div><div>Philipp </div><div><br></div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">Am Mo., 8. Apr. 2019 um 23:01 Uhr schrieb Stéphane Mottelet <<a href="mailto:stephane.mottelet@utc.fr">stephane.mottelet@utc.fr</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div bgcolor="#FFFFFF">
<p>Le 08/04/2019 à 22:56, Federico Miyara a écrit :<br>
</p>
<blockquote type="cite">
<br>
<font face="Courier New">Stéphane,<br>
<br>
Sometimes one just needs to extract some parameter from an
entity and indexing is a valid way to access it.<br>
</font></blockquote>
<p><font face="Courier New">So what is your problem since you know
that the order of entities is, though not natural, reproductible
? If you really need to recover a deeply hidden entity, use tags
and the findobj() function.</font></p>
<p><font face="Courier New">S.<br>
</font></p>
<blockquote type="cite"><font face="Courier New"> <br>
Federico<br>
<br>
</font><br>
<div class="gmail-m_-570024488477070350moz-cite-prefix">On 08/04/2019 12:18, Stéphane
Mottelet wrote:<br>
</div>
<blockquote type="cite">
<p>Hello,<br>
</p>
<div class="gmail-m_-570024488477070350moz-cite-prefix">Le 07/04/2019 à 10:13, Federico
Miyara a écrit :<br>
</div>
<blockquote type="cite">
<br>
<font face="Courier New">Dear all,<br>
<br>
I would like to know if there is a reason for the fact that
whenever new graphic objects are added to an axes, the last
one that has been created is always the one with index 1
instead of n+1 (where n is the number of objects prior to
new one).<br>
<br>
Example:</font><span style="color:rgb(0,0,0)"><br>
<br>
</span><span style="color:rgb(0,0,0)">scf</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(74,85,219)">)</span> <br>
<span style="color:rgb(0,0,0)">clf</span><span style="color:rgb(74,85,219)">(</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)"><br>
<br>
</span><span style="color:rgb(75,149,50);font-style:italic">//
Plot a simple two-point graph <br>
</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(188,143,143)">0</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(0,0,0)">,</span> <span style="color:rgb(74,85,219)">[</span><span style="color:rgb(188,143,143)">0</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(74,85,219)">)</span> <br>
<span style="color:rgb(0,0,0)">ax</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">gca</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">)</span><br>
<span style="color:rgb(74,85,219)"></span><br>
<span style="color:rgb(75,149,50);font-style:italic">//
Colect plotted data </span><br>
<span style="color:rgb(0,0,0)">a</span> <span style="color:rgb(92,92,92)">=</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)">1</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">children</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">data<br>
</span> <span style="color:rgb(50,185,185)"></span><br>
<span style="color:rgb(50,185,185)"></span><span style="color:rgb(75,149,50);font-style:italic">// Plot a
simple two-point graph <br>
</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(188,143,143)">0</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(0,0,0)">,</span><span style="color:rgb(74,85,219)">[</span><span style="color:rgb(188,143,143)">0.5</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(188,143,143)">1.5</span><span style="color:rgb(74,85,219)">]</span><span style="color:rgb(74,85,219)">)<br>
</span> <br>
<span style="color:rgb(0,0,0)"><span style="color:rgb(75,149,50);font-style:italic">// Colect
plotted data corresponding to index 1</span><br>
<span style="color:rgb(0,0,0)"></span>b</span> <span style="color:rgb(92,92,92)">=</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)">1</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">children</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">data</span> <span style="color:rgb(0,0,0)"><br>
<br>
</span><span style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)"><span style="color:rgb(75,149,50);font-style:italic">//
Colect plotted data corresponding to index 2</span><br>
<span style="color:rgb(0,0,0)"></span></span>c</span> <span style="color:rgb(92,92,92)">=</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(92,92,92)">.</span><span style="color:rgb(170,170,170)">children</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">data<br>
<br>
</span><font face="Courier New">After the first plot we get <br>
<br>
a = <br>
0. 0.<br>
1. 1.<br>
<br>
After the second plot we get<br>
<br>
b = <br>
0. 0.5<br>
1. 1.5<br>
<br>
c = <br>
<br>
0. 0.<br>
1. 1.<br>
</font><span style="color:rgb(0,0,0)"> </span><br>
I would expect that b = a, i.e, once a children object has
been created on the axes, it would be reasonable that its
index were kept constant. The current behavior is as if each
new object were inserted in the structure before the previous
one instead of after it. <br>
</blockquote>
<p>I would say that the set of children is a stack, i.e. each
new child is "pushed" on top. Anyway, relying on child order
seems, to me, a bad idea. For example, legend takes as
(optional) first argument an array of handles, and not an
array of child numbers.</p>
<p>S.<br>
</p>
<blockquote type="cite">
<br>
Regards,<br>
<br>
Federico Miyara<br>
<br>
<div id="gmail-m_-570024488477070350DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top-color:rgb(211,212,222);border-top-width:1px;border-top-style:solid">
<tbody>
<tr>
<td style="width:55px;padding-top:18px"><a href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img width="46" height="29" style="width: 46px; height: 29px;" alt="" src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"></a></td>
<td style="width:470px;color:rgb(65,66,78);line-height:18px;padding-top:17px;font-family:Arial,Helvetica,sans-serif;font-size:13px">Libre de
virus. <a style="color:rgb(68,83,234)" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank">www.avast.com</a> </td>
</tr>
</tbody>
</table>
<a href="#m_-570024488477070350_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" height="1" width="1"> </a></div>
<br>
<fieldset class="gmail-m_-570024488477070350mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_-570024488477070350moz-quote-pre">_______________________________________________
users mailing list
<a class="gmail-m_-570024488477070350moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a class="gmail-m_-570024488477070350moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" target="_blank">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<fieldset class="gmail-m_-570024488477070350mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
users mailing list
<a class="gmail-m_-570024488477070350moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a class="gmail-m_-570024488477070350moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="gmail-m_-570024488477070350mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_-570024488477070350moz-quote-pre">_______________________________________________
users mailing list
<a class="gmail-m_-570024488477070350moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a class="gmail-m_-570024488477070350moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" target="_blank">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
</div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noreferrer">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>