How to make a Subplots using set(gca,'position') command?
Show older comments
I would like to make one figure, with two subplots.
The dimensions for each subplot
set(gca,'Position', [0.1000 0.5971 0.2335 0.3279]) % subplot 1
hold on;
set(gca,'Position', [0.4700 0.5971 0.2335 0.3279]) % subplot 2
However, when I use this command, only the last figure axis remains, the first one disappears.
The hold on does not seem to work in this case.
Any help is greatly appriciated.
Thnak you in advance!
4 Comments
"However, when I use this command, only the last figure axis remains, the first one disappears."
Your code only refers to one axes, which otherwise does not change and certainly does not "disappear". Nothing in your code creates or deletes axes: it simply takes one existing(?) axes and keep changing its position, that is all.
"The hold on does not seem to work in this case."
HOLD is basically unrelated to your moving one axes around the figure.
MP
on 1 Mar 2023
Jonas
on 2 Mar 2023
thanks @Stephen23
Accepted Answer
More Answers (0)
Categories
Find more on Subplots 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!
