<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Le 07/06/2022 à 11:39, CRETE Denis a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:b6ac0d77b14b479fac558110cd883fca@thalesgroup.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",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éformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;
mso-fareast-language:FR;}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:12.0pt;
font-family:"Times New Roman",serif;}span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}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]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Hello,
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">I have several graphic windows and in some of
them, there are several “Axes” (and several curves for each
“Axes”).<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">I can’t find in “Scilab Help” if the “current
axes” is always in the hierarchy of the “current entity”,
and similarly if the “current figure” is always in the
hierarchy of the “current axes”. </span></p>
</div>
</blockquote>
<p>Good question. Let's test it :</p>
<ol>
<li><font face="monospace">sca(ax)</font> sets the current figure
to the one homing the ax axes:<br>
<font face="monospace">--> scf(0); plot(1:10); e0 = gce();
ax0 = gca();<br>
--> scf(1); plot(1:10); e1 = gce(); ax1 = gca();<br>
--> sca(ax0);<br>
--> gcf().figure_id<br>
ans =<br>
0.<br>
--> sca(ax1);<br>
--> gcf().figure_id<br>
ans =<br>
1.<br>
<br>
</font></li>
<li><font face="monospace">set("current_entity", h)</font> does
NOT set the current figure to the one homing the targeted
entity:<br>
<font face="monospace">--> scf(0); plot(1:10); e0 = gce();
ax0 = gca();<br>
--> scf(1); plot(1:10); e1 = gce(); ax1 = gca();<br>
--> set("current_entity", e0);<br>
--> gcf().figure_id<br>
ans =<br>
1.<br>
--> gca().parent.figure_id<br>
ans =<br>
1.</font></li>
</ol>
<p>So now we can answer to your questions:</p>
<p>
<blockquote type="cite"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">I can’t find in “Scilab Help” if the “current
axes” is always in the hierarchy of the “current entity”,</span></blockquote>
Almost never.<br>
<br>
<blockquote type="cite"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US"> and similarly if the “current figure” is always
in the hierarchy of the “current axes”. </span></blockquote>
Yes it is.<br>
<br>
</p>
<br>
<blockquote type="cite"
cite="mid:b6ac0d77b14b479fac558110cd883fca@thalesgroup.com">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">If this was true, I suggest to mention it in
the “Graphics Entities” section.<br>
</span></p>
</div>
</blockquote>
Right, the sca() and set() pages could be clarified about this.<br>
<br>
<blockquote type="cite"
cite="mid:b6ac0d77b14b479fac558110cd883fca@thalesgroup.com">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">If not, is there a simple way to obtain the
handle of the figure where the “current entity” is ?<br>
I tried the following, which seems to work :<o:p></o:p></span>
</p>
</div>
</blockquote>
<blockquote type="cite"
cite="mid:b6ac0d77b14b479fac558110cd883fca@thalesgroup.com">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">G_f = gce().parent;<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">while get(G_f,”type”)~=”Figure”,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US"> G_f = G_f.parent;<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">end;</span></p>
</div>
</blockquote>
Yes, in short:<br>
<br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">G_f = gce();<br>
</span>
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">while G_f.type ~= ”Figure”</span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"
lang="EN-US">, G_f = G_f.parent; end</span></p>
</div>
<br>
that will work even when the initial G_f is already a figure.<br>
<br>
Samuel<br>
<br>
</body>
</html>