フィルターのクリア

how to change, by using commands, the space between plots when using a subplot?

1 回表示 (過去 30 日間)
Thelma
Thelma 2011 年 4 月 26 日
I am plotting three boxplots at the same time by using the command subplot. I need to reduce the space between them. how can I do that by using commands? Thanks in advance.

回答 (1 件)

Jarrod Rivituso
Jarrod Rivituso 2011 年 4 月 26 日
I can think of two ways
1. Manually move the axes position
>> ah = subplot(2,2,1)
>> currentPos = get(ah,'Position');
>> set(ah,'Position',currentPos - [10,10,0,0])
2. Make the axes span multiple subplots of a finer grid. For instance, try this:
>> figure(1); subplot(4,4,[1 2 5 6])
>> figure(1); subplot(4,4,[3 4 7 8])
>> figure(2); subplot(2,2,1)
>> figure(2); subplot(2,2,2)
You will see that figure 1 has tighter spacing
  2 件のコメント
Oleg Komarov
Oleg Komarov 2011 年 4 月 26 日
Jarrod can you please post the code w/o the >> in your next answers?
Jarrod Rivituso
Jarrod Rivituso 2011 年 4 月 26 日
Sure. I've been adding the >> to signify stuff you can do from the command prompt, as opposed to stuff you would write in the function (it's a habit I got into a while back). I'll stop doing it though since it helps the copy - paste thing

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

カテゴリ

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