How do you superimpose subplots? There's no script to read here. This is simply a conceptual question.
6 views (last 30 days)
Show older comments
Let's say I have two figures, each showing a set of subplots. Each figure has 2 rows of 6 subplots. I sub-plotted these subplots using a loop.
How should script be altered such that instead of plotting the second set of subplots in a new figure, they will be superimposed onto the first set?
Thanks for any feedback you can give me.
1 Comment
Answers (1)
Walter Roberson
on 22 May 2012
You cannot do this directly using subplot() . subplot() is defined to look to see if there are any other axes already in the area and to delete them if there is.
Instead of using subplot() to create new axes that will overlap the other axes, uses axes() to create new axes, and set() their Position to be the same as what you want to overlap.
You will need to set the background color of the top axes to "none" in order for the axes underneath to be visible.
The axes and labels and tick-marks of both axes will be visible, which might not be readable.
I suggest that you consider instead drawing two plots in each subplot() axes. plotyy() might help.
0 Comments
See Also
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!