How to make a subplot into a new standalone figure?
87 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
K E
am 27 Feb. 2014
Kommentiert: Ash Ash
am 12 Jul. 2020
A colleague is giving me several fig files, each of which contains several subplots. What is the way that I can "copy" a subplot to a new standalone figure, including lines, x/y labels, and title? I would like to insert this in the following code, so I can automatically generate a figure for every subplot in the workspace.
% Make some fake figures
for iFig = 1:3
for iSub = 1:4
figure(iFig);
subplot(2,2,iSub);
end
end
% Get handles to all subplots
hAx = findobj('type', 'axes');
for iAx = 1:length(hAx)
axes(hAx(iAx));
% Do something here to generate a new figure containing
% lines/labels copied from this axis
end
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 27 Feb. 2014
2 Kommentare
Ash Ash
am 12 Jul. 2020
Thank you! This code solved my problem. All I needed to do was to tweak the axes position values to fit my monitor resolution.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!