2016-05-04 14 views
0

プロット数がrowxcolumns未満の場合、サブプロットをFigureの中央に揃えることは可能ですか?例えば;プロット数がrowxcolumns未満の場合、サブプロットをFigureの中央に揃える方法はありますか?

私はこれを使用する場合:

figure 
for pl=1:5 
     subplot(3,2,pl) 
end 

を、私はこの結果を得る:enter image description here 私は何とか最後の行が一つだけのプロットを持っているので、以下に示すように、それは中央揃え取得した次のような出力を得ることができますか? enter image description here

答えて

1

サブプロット使用時に作成された軸の位置を手動で更新することができます。

figure 
for pl=1:5 
    ax(pl) = subplot(3,2,pl) 
end 
% post r2014b 
ax(5).Position(1) = 0.5-ax(5).Position(3)/2; 

次へ最後の行を変更する必要がr2014bあなたは、MATLABの前を使用している場合:

% pre r2014b 
pos = get (ax(5), 'position'); 
pos(1) = 0.5-pos(3)/2; 
set (ax(5), 'position', pos); 
関連する問題