How do you superimpose subplots? There's no script to read here. This is simply a conceptual question.
10 次查看(过去 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 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!