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

7 次查看(过去 30 天)
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 个)

Walter Roberson
Walter Roberson 2012-5-22
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.

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by