Use uistack (see doc ). For example, after:
figure hold on hblue=plot([1 2],[3 4],'b','LineWidth',5); hred=plot([1 2],[4 3],'r','LineWidth',5);
the red line is on top (and the blue line will not be visible if the red line has covered it). Then, if you use uistack(hblue,'top') , a blue line is displayed at the top. Other options for changing the order of the charts instead of top are up , down and bottom . You can specify the number of steps up or down (for example, uistack(h,'up',2) to move the handle two layers up - although in my simple example it is not necessary).
If, as you say, “the hblue file is saved” and you don’t have grips for graphs ( hblue and hred in my example), after loading the plot you can get it with get(gca,'children') .
source share