
How to have three figures side-by-side to create one composite figure?
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi guys,
A basic question. I have the below test input. I want to put the three generated figures side-by-side and export it as one image like I am doing now. But I want these figures to be side-by-side and have some form of a border/separation/panel between them? I want to create ONE horizontal figure composed of these three 'sub-figures' (i.e., a composite figure).
Thank you
figure(1)
surf(peaks);
colormap(winter);
title('FIGURE 1A', 'FontSize', 12, 'fontweight', 'bold')
figure(2)
surf(peaks);
colormap(autumn);
title('FIGURE 1B', 'FontSize', 12, 'fontweight', 'bold')
figure(3)
surf(peaks);
colormap(spring);
title('FIGURE 1C', 'FontSize', 12, 'fontweight', 'bold')
export_fig FIGURE_1.tiff -m3 -q101 -nocrop
댓글 수: 0
채택된 답변
Image Analyst
2015년 5월 10일
Try this:
h1 = subplot(1,3,1);
surf(peaks);
colormap(h1, winter);
axis square;
title('FIGURE 1A', 'FontSize', 12, 'fontweight', 'bold')
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
h2 = subplot(1,3,2);
surf(peaks);
axis square;
colormap(h2, autumn);
title('FIGURE 1B', 'FontSize', 12, 'fontweight', 'bold')
h3 = subplot(1,3,3);
surf(peaks);
colormap(spring);
axis square;
title('FIGURE 1C', 'FontSize', 12, 'fontweight', 'bold')

댓글 수: 5
Image Analyst
2015년 5월 11일
I don't see that line() can draw lines on the figure itself so I think you have to use a panel, which has a line around it. Set the string property to null so no words show up on the line. That should work, though you can't use subplot - you'll probably have to use GUIDE or else do it yourself with some difficulty using uicontrol().
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!