<div dir="ltr"><div>Hallo Robert,</div><div><br></div><div> If you use xpoly() it means you know your data before you plot it?</div><div>--> I mean: you do not click in the figure to get the coordinates....<br></div><div>--> Why not plot all data at once?</div><div><br></div><div>E.g.: Can you not plot all polylines in one single plot2d command?<br></div><div><br></div><div>If you can't, you may try following approach:</div><div></div><div>Assumption: all data is of same length, e.g.: all lines are drawn by same number of points<br></div><div><br></div><div>1.) you may access the data that composes the plot by searching for:    *.children.data <br></div><div>   * =: I do not recall from memory how deep you have to search....</div><div>   e.g.:</div><div>   plot2d();  <br></div><div>   a = gca();</div><div>   a.children.children.data....or 
.....a.children.children.children.data

</div><div><br></div><div>2.: Save the 
*.children.data separately in a X-matrix and Y-matrix</div><div><br></div><div>3.: Add the data that you would plot with xpoly() to these matrices.</div><div><br></div><div>4.: xdel()</div><div><br></div><div>5.: replot everything with  plot2d(X-matrix, Y-matrix)</div><div><br></div><div>This should give you all lines at the same plot-hirachy.</div><div>I did not check, but I would guess that also the line order would not change.<br></div><div><br></div><div>It should be possible to create a function out of this and loop though it each time a xpoly() is added to the plot.<br></div><div><br></div><div><br></div><div></div><div>Again, it is not clear why you just do not fuse all data together into one matrix and use plot2d() to plot all data at once.<br></div><div><br></div><div><br></div><div>Best Regards,</div><div>Philipp<br></div><br><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Sa., 13. Juni 2020 um 20:05 Uhr schrieb RolandB <<a href="mailto:jdb61858@suoox.com">jdb61858@suoox.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
If one plots several curves into a 2D axes using plot2d(), the curves will<br>
be resembled as polyline children within a compound, which is a child of the<br>
according axes.<br>
Adding further polylines one by one using xpoly() puts these polylines<br>
outside the compound on the same level as the compound is located, as<br>
children of the according axes.<br>
<br>
Is there a simple way to have the polyline generated directly within the<br>
existing compound?<br>
I know that I can glue several polylines into a compound, but I would have<br>
to unglue the compound first and then glue all polylines together back into<br>
one compound.<br>
Having many (!) curves makes this quite slow. Especially as glue() reverses<br>
the order of the polylines, so I would have to do a second unglue();glue();<br>
in order to preserve the order they had before ungluing (BTW, is this a bug<br>
or is reversal of the order a desired feature?).<br>
<br>
On the other hand, what kind of advantage does the compound have at all,<br>
assuming I wouldn't need the possibility of making all of the curves in the<br>
compound visible or invisible by just modifying the visibility of the<br>
compound?<br>
Ok, I can address all curves by axes.children.children(1:$) without having<br>
to care about the legend, which would be together with the curves in<br>
axes.children(1:$) if all the polylines were not in a compound.<br>
<br>
But any additional advantage for using a compound?<br>
<br>
Regards,<br>
Roland<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html" rel="noreferrer" target="_blank">http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html</a><br>
_______________________________________________<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" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>