Adding a subplot axes to an existing figure.
16 views (last 30 days)
Show older comments
Greetings -
Is there away to expand the size of a subplot grid once it has been created. Suppose I the following subplot:
h = figure();
h1 = subplot(2,1,1); plot(rand(10,1));
h2 = subplot(2,1,2); plot(rand(10,1));
I would like to be able to add a third subplot to the array without recreating the figure.
I have looked into two ways of doing it so far. Once with modifying the appdata for the figure using getappdata(h, with "SubplotListeners" and "SubplotGrid" and havent had much sucess. The other thing I was considering is simply creating a new figure off the screen, copying the axes handles over to it and moving it into the screen while deleting the old one.
Has anyone has sucess with something similar to this?
Best Regards,
Brandon
0 Comments
Answers (1)
Walter Roberson
on 26 Jul 2012
subplot() works by position. Set new Position (or possibly OuterPosition) for the existing subplots and then you can subplot() the new one into place. If I recall correctly, you can read the source,
type subplot
0 Comments
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!