Multiple figures of varying sizes into a single figure
조회 수: 8 (최근 30일)
이전 댓글 표시
I have 3 figures (of varying sizes) generated from 3 functions I wrote, and each generated figure is of very different size, customized to best display the graph/statistics.
See the sample outputs below:
generateFigure1(data)
output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171198/image.png)
generateFigure2(data)
output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171199/image.png)
generateFigure3(data)
output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171200/image.png)
I would like to have a master figure which includes all of the three figures like below, keeping the sizes of original figures:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171201/image.png)
I have tried,
subplot(3,2,1)
generateFigure1(data)
subplot(3,2,2)
generateFigure2(data)
subplot(3,2,5)
generateFigure3(data)
And figures overlap one another completely.. any help would be greatly appreciated!
댓글 수: 0
답변 (1개)
A Mackie
2018년 3월 13일
Within each subplot try altering the axis 'Position' property - this doesn't just move the position but also can change the size. For instance
subplot(3,2,1)
generateFigure1(data)
subplot(3,2,2)
generateFigure2(data)
ax = gca;
ax.Position = [0.5 0.3 0.4 0.2]
subplot(3,2,5)
generateFigure3(data)
will alter the position and size of figure 2.
댓글 수: 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!