<p>I'm trying to create figures in MatLab and am a reasonably new user, I'm wondering if there is a good way to make plots that use a common x-axis and then vertically stacked and alternating y-axes as in the picture below.</p>

<p>So far I have been using the subplot function and it's not really doing the trick for me.</p>

<p>Thanks!</p>

<p><a href="https://i.sstatic.net/x9z4z.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/x9z4z.png" alt="Example plot"></a></p>

CC BY-SA 4.0
2020-03-31T07:46:49.993Z
I don't think MATLAB allows you to create a plot like this at all. You can create a bunch of plots, save the MATLAB figure as .eps or .pdf files, open those files in Adobe Illustrator (or any vector-based program like it) and combine the lot into a single figure. What do you think about that approach? Would that answer your question? Be sure, though, to check out https://www.mathworks.com/help/matlab/ref/stackedplot.html for a kind-of solution.
Erik
CC BY-SA 4.0
2020-03-31T10:23:41.387Z
I don't think this is an earth science question, the method should work regardless of what data we're plotting. Stackoverflow may be a better place for this - you're more likely to have it seen by people proficient in matlab there.
Lio Elbammalf
CC BY-SA 4.0
2020-04-01T08:04:02.000Z
Voting to close or migrate to Stackoverflow, this is a programming issue, not an earth science one.
Jean-Marie Prival
<geochemistry><matlab><paleoclimate>
MATLAB - How to plot multiple timeseries (paleoclimate) with a common x axis and multiple stacked y axes?
Harry
# MATLAB - How to plot multiple timeseries (paleoclimate) with a common x axis and multiple stacked y axes?

(Asked by: username_0 on 2020-03-31)

I'm trying to create figures in MatLab and am a reasonably new user, I'm wondering if there is a good way to make plots that use a common x-axis and then vertically stacked and alternating y-axes as in the picture below.

So far I have been using the subplot function and it's not really doing the trick for me.

Thanks!

[![Example plot](https://i.sstatic.net/x9z4z.png)](https://i.sstatic.net/x9z4z.png)

**Tags:** geochemistry, matlab, paleoclimate

> **Comments:**
> **username_1**: I don't think MATLAB allows you to create a plot like this at all. You can create a bunch of plots, save the MATLAB figure as .eps or .pdf files, open those files in Adobe Illustrator (or any vector-based program like it) and combine the lot into a single figure. What do you think about that approach? Would that answer your question? Be sure, though, to check out https://www.mathworks.com/help/matlab/ref/stackedplot.html for a kind-of solution.  
> **username_2**: I don't think this is an earth science question, the method should work regardless of what data we're plotting. Stackoverflow may be a better place for this - you're more likely to have it seen by people proficient in matlab there.  
> **username_3**: Voting to close or migrate to Stackoverflow, this is a programming issue, not an earth science one.  

---

## 0 answers

