figure内の図の​大きさを指定する方法​を教えていただけない​でしょうか?

現在figure内にsubplotを使用して2つの図を上下に作成しようしています。
しかし,片方の波形にカラーマップを追加するため,上下の図の大きさが異なってしまいます。
そこで,figure内の図の大きさを指定する方法などご教示いただけないでしょうか?

댓글 수: 3

Walter Roberson
Walter Roberson 2017년 7월 12일
Approximate translation:
Could you tell me how to specify the size of figure in the figure?
I'm trying to create two figures up and down using subplot in figure now.
However, since the color map is added to one waveform, the size of the upper and lower figures will be different.
So, could you teach us how to specify the size of figures in figure?
Walter Roberson
Walter Roberson 2017년 7월 12일
Please look at the axes Position and OuterPosition properties; https://www.mathworks.com/help/matlab/ref/axes-properties.html#property_d0e56306
Ryosuke Takahashi
Ryosuke Takahashi 2017년 7월 14일
Thank you for your reply.
I will confirm it.

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

 채택된 답변

michio
michio 2017년 7월 14일

3 개 추천

colorbarマップを作成する際に、'position' プロパティを 'manual' で明示的に指定するようにすると、図の大きさは自動で変更されません。例えば・・
figure(1)
subplot(2,1,1);
surf(peaks)
subplot(2,1,2);
surf(peaks), colorbar('location','manual','position',[0.85 0.4 0.02 0.08]);

댓글 수: 1

mizuki
mizuki 2017년 7월 14일
편집: mizuki 2017년 7월 14일
Michio さんのご提案のように colorbar の 'position' プロパティを変更する方法もありますし、subplot の軸を後で調整することもできます。
Walter さんが紹介しているプロパティリストURLが参考になるかと思います。
figure
% ひとつめの図の描画
a1 = subplot(2,1,1);
Z = peaks(20);
contourf(Z,10);
% colorbar をつける
h_bar = colorbar;
h_bar.Location = 'east';
a1.Position(3:4) = [0.7750 0.3412];
h_bar.Position(1) = 0.94;
% ふたつめの図の描画
a2 = subplot(2,1,2);
plot(rand(5));

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 用途에 대해 자세히 알아보기

제품

질문:

2017년 7월 12일

댓글:

2017년 7월 14일

Community Treasure Hunt

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

Start Hunting!