Given a plot of three curves in a .fig file I'd like to add another plot (with hold all
and plot
), but put it behind one of the already existing curves (i.e. make sure the last original curve stays the foreground one). Can this be achieved without having to extract the plot data and re-plotting?
If you know the handle of line you want on top (e.g. because you called h = plot(...)
, you can use uistack
uistack(h,'top')
Alternatively, you can manipulate the order of children of your current axes directly. The following puts the last-most curve on top.
chH = get(gca,'Children')
set(gca,'Children',[chH(end);chH(1:end-1)])