<p>When you plot things in Matlab, the most recently plotted data series is placed on top of whatever's already there. For example:</p>

<pre><code>figure; hold on
plot(sin(linspace(0,pi)),'linewidth',4,'color',[0 0 1])
plot(cos(linspace(0,pi)),'linewidth',4,'color',[1 0 0])
</code></pre>

<p>Here, the red line is shown on top of the blue line (where they intersect). Is there any way to set "how deep" a line is drawn, so that you can plot things <em>beneath</em> what's already there?</p>

Use the
uistack
command.  For example:
```
```
h1 = plot(1:10, 'b');
hold on;
h2 = plot(1:10, 'r');
```
```
will plot two lines with the red line plotted on top of the blue line.  If you then do:
```
```
uistack(h1);
```
```
the blue line will be brought to the front.