필터 지우기
필터 지우기

is it possible to use square subplots?

조회 수: 75 (최근 30일)
Mr M.
Mr M. 2015년 7월 7일
댓글: Jan 2015년 7월 7일
if I use axis image: the problem is the gaps are too big between subplots, I would like to adjust the figure size also automatically, if possible

채택된 답변

Image Analyst
Image Analyst 2015년 7월 7일
You can use "axis square" though that does not do anything for the large amount of blank space between plots. You'll need set(gca, 'Position', [x,y,w,h]) for that.

추가 답변 (2개)

Jan
Jan 2015년 7월 7일
편집: Jan 2015년 7월 7일
figure('Position', [100, 100, 400, 400]);
axes
axis('equal') % [EDITED: or better 'square' !]
  댓글 수: 2
Mr M.
Mr M. 2015년 7월 7일
figure can be handled as a plot? its very strange for me, since I cannot set title for example! So what is the difference between figures, plots, and subplots?
Jan
Jan 2015년 7월 7일
@Mr. M: The documentation is clear:
doc figure
doc plot
doc subplot
figure creates a window. plot draws a line and creates an axes object implicitly. subplot creates an axes object with a specific position - so "subaxes" would be a better name.

댓글을 달려면 로그인하십시오.


Ivan Shorokhov
Ivan Shorokhov 2015년 7월 7일
편집: Ivan Shorokhov 2015년 7월 7일
For each subplot, store its handle.
h = subplot(2,3,1);
Then set the 'position' property of h to be anything you want.
p = get(h, 'pos');
This is a 4-element vector [left, bottom, width, height] which by default is in normalized coordinates (percentage of figure window). For instance, to add 0.05 units (5% of figure window) to the width, do this:
p(3) = p(3) + 0.05;
set(h, 'pos', p);
The SUBPLOT command picks standard values for these parameters, but they could be anything you want. You could put axes anywhere on the figure you want, any size you want.
Please vote for the answer.
  댓글 수: 3
Ivan Shorokhov
Ivan Shorokhov 2015년 7월 7일
편집: Ivan Shorokhov 2015년 7월 7일
Mr M.
Mr M. 2015년 7월 7일
aspect ratio is not working for me, as I expect, for example I expect axis image is something like this: set(gca,'xlim',[-0.5 0.5],'ylim',[-0.5 0.5]);axis equal; however my plots are rectangles!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by