How do you superimpose subplots? There's no script to read here. This is simply a conceptual question.

10 Ansichten (letzte 30 Tage)
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.

Antworten (1)

Walter Roberson
Walter Roberson am 22 Mai 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.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by