Say I have some function that cannot be changed and it returns this:
all_plots:=display([plot(sin(10*x+0.2),x=0..1, thickness=10, color=blue), plot(1-sin(10*x),x=0..1, thickness=10, color=red), plot(sin(10*x),x=0..1, thickness=10, color=green)]):
Now can plot it as:
plots:-display( all_plots );
...but what if I need the (say) red curve to be "on top" (fully visible), green curve in the middle, and blue curve at the bottom (as is now).
what is the most effective way to do this?
i guess this works:
display([convert(all_plots, list), convert(all_plots, list), convert(all_plots, list)]);
... lookst like above doesn't keep all the extra options that a plot can have... here is a version that seems to do it.
#Reorder should be a list of index pairs like
#[[3,5], [-1, 1], ...]
local p, temp, curves:=, rest:=:
#separate curves from rest (there must be a prettier way to do this)
for p in convert(v_items, list) do
if type(p,'function') and op(0,p) = ('CURVES') then
for p in v_reorder do
#change say second last with last curve:
rearrangeCurves(all_plots, [[-2, -1]]);