How can I make subplots larger?

155 ビュー (過去 30 日間)
Edward
Edward 2014 年 3 月 3 日
編集済み: Thomas 2014 年 3 月 3 日
Is there a way I can increase the vertical size of 4 subplots that are in a column? If I have 1 X variable and 4 Y:
x=1:10;
y1=x.^0.5;
y2=x;
y3=x.^2;
y4=x.^3;
subplot(4,1,1);
plot(x,y1);
subplot(4,1,2);
plot(x,y2);
etc
What can I do to make these plots just as spaced out but larger vertically?
  1 件のコメント
dpb
dpb 2014 年 3 月 3 日
Wouldn't that be the same (or nearly so) as
subplot(2,1,1)
etc., ...?
You can always play with the 'position' property of the axis to adjust as you wish. I've done things like create a 3x3 grid then delete four to leave five with the one centered in the middle to save a little in creating the ones where wanted. Perhaps if you consider the end effect you're looking for something along that line would be more direct...

サインインしてコメントする。

採用された回答

Thomas
Thomas 2014 年 3 月 3 日
編集済み: Thomas 2014 年 3 月 3 日
Do you just want to make the figure taller?
x=1:10;
y1=x.^0.5;
y2=x;
y3=x.^2;
y4=x.^3;
figure1=figure('Position', [100, 100, 1024, 1200]);
subplot(4,1,1);
plot(x,y1);
subplot(4,1,2);
plot(x,y2);
subplot(4,1,3);
plot(x,y3);
subplot(4,1,4);
plot(x,y4);

その他の回答 (1 件)

Srinivas
Srinivas 2014 年 3 月 3 日
x=1:10;
y1=x.^0.5;
y2=x;
y3=x.^2;
y4=x.^3;
sp_hand1 = subplot(4,1,1);
plot(x,y1);
sp_hand2 = subplot(4,1,2);
plot(x,y2);
pos1 = get(sp_hand1, 'Position') % gives the position of current sub-plot
new_pos1 = pos1 +[0 0 0 0.05]
set(sp_hand1, 'Position',new_pos1 ) % set new position of current sub - plot
you can space them like this, check documentation on
get, set

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by