is it possible to reorder plots?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

is it possible to reorder plots?

Octave - General mailing list
Hello,

if you run

>> clear all
>> x = 1:10;
>> y1 = x + 1;
>> y2 = -x + 10;
>> p1 = plot(x,y1,"r","LineWidth",5);
>> hold on
>> p2 = plot(x,y2,"k","LineWidth",5);

plot p2 will be over p1.

If I want p1 over p2 I could just reverse the sequence of commands (plot p2 and then plot p1).

But my question is:

Is it possible to put p1 over p2 without reversing the order of commands, I mean, if p1 and p2 are already plotted, is is possible to reorder the plots in a figure?

Is there a field that keeps the "children order" or "plot order"?

Kind regards,
Leonardo