[Scilab-users] Plotting a New Xpoly Directly Inside a Compound

P M p.muehlmann at gmail.com
Fri Jun 19 15:41:18 CEST 2020


Hallo Robert,

 If you use xpoly() it means you know your data before you plot it?
--> I mean: you do not click in the figure to get the coordinates....
--> Why not plot all data at once?

E.g.: Can you not plot all polylines in one single plot2d command?

If you can't, you may try following approach:
Assumption: all data is of same length, e.g.: all lines are drawn by same
number of points

1.) you may access the data that composes the plot by searching for:
*.children.data
   * =: I do not recall from memory how deep you have to search....
   e.g.:
   plot2d();
   a = gca();
   a.children.children.data....or .....a.children.children.children.data

2.: Save the *.children.data separately in a X-matrix and Y-matrix

3.: Add the data that you would plot with xpoly() to these matrices.

4.: xdel()

5.: replot everything with  plot2d(X-matrix, Y-matrix)

This should give you all lines at the same plot-hirachy.
I did not check, but I would guess that also the line order would not
change.

It should be possible to create a function out of this and loop though it
each time a xpoly() is added to the plot.


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.


Best Regards,
Philipp







Am Sa., 13. Juni 2020 um 20:05 Uhr schrieb RolandB <jdb61858 at suoox.com>:

> Hi,
>
> If one plots several curves into a 2D axes using plot2d(), the curves will
> be resembled as polyline children within a compound, which is a child of
> the
> according axes.
> Adding further polylines one by one using xpoly() puts these polylines
> outside the compound on the same level as the compound is located, as
> children of the according axes.
>
> Is there a simple way to have the polyline generated directly within the
> existing compound?
> I know that I can glue several polylines into a compound, but I would have
> to unglue the compound first and then glue all polylines together back into
> one compound.
> Having many (!) curves makes this quite slow. Especially as glue() reverses
> the order of the polylines, so I would have to do a second unglue();glue();
> in order to preserve the order they had before ungluing (BTW, is this a bug
> or is reversal of the order a desired feature?).
>
> On the other hand, what kind of advantage does the compound have at all,
> assuming I wouldn't need the possibility of making all of the curves in the
> compound visible or invisible by just modifying the visibility of the
> compound?
> Ok, I can address all curves by axes.children.children(1:$) without having
> to care about the legend, which would be together with the curves in
> axes.children(1:$) if all the polylines were not in a compound.
>
> But any additional advantage for using a compound?
>
> Regards,
> Roland
>
>
>
>
> --
> Sent from:
> http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200619/a12aba9b/attachment.htm>


More information about the users mailing list