How to make a subplot into a new standalone figure?
조회 수: 93 (최근 30일)
이전 댓글 표시
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
채택된 답변
Sean de Wolski
2014년 2월 27일
댓글 수: 2
Ash Ash
2020년 7월 12일
Thank you! This code solved my problem. All I needed to do was to tweak the axes position values to fit my monitor resolution.
추가 답변 (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!