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.


Example plot

  • $\begingroup$ 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 mathworks.com/help/matlab/ref/stackedplot.html for a kind-of solution. $\endgroup$ – Erik Mar 31 at 7:46
  • 1
    $\begingroup$ 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. $\endgroup$ – Lio Elbammalf Mar 31 at 10:23
  • 1
    $\begingroup$ Voting to close or migrate to Stackoverflow, this is a programming issue, not an earth science one. $\endgroup$ – Jean-Marie Prival Apr 1 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.