how can i make subplots larger without manually stretching them ?

11 ビュー (過去 30 日間)
ADNAN KIRAL
ADNAN KIRAL 2021 年 8 月 2 日
コメント済み: Bjorn Gustavsson 2021 年 8 月 2 日
Hi,
how can I make my plot larger (equally without manually doing that)?
like such plot ?
thanks in advance

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 8 月 2 日
For figures like this I find it important to remove the xlabel-text except along the bottom row - this saves valuable real-estate that the axes then doesnt have to shrink to accomodate. In order to get this I also find it preferable to have the same x-limits on every subplot column - then it also becomes useful to remove the xticklabels on every axes except the bottom one. The plotting is typically done with the decorations like this:
for i1 = 1:28
sph(i1) = subplot(7,4,i1)
plot(x{i1},y{i1},'r.-');
axis([something suitable])
% maybe: set(gca,'xtick',[5:8]) % this should be adjusted according too
% need
if i1 <= 24
set(gca,'xticklabel','','tickdir','out') % sometimes worthwhile to increase ticklength too
else
set(gca,'tickdir','out')
xlabel('Distance [cm]') % adjust to needs
end
end
Then you can further programmatically increase the size of each subplot to squeeze out more space (I often find this too fiddly):
set(sph(1),'position',get(sph(1),'position')+[-0.05 -0.05 0.1 0.1]) % this should be twiddled
HTH
  2 件のコメント
ADNAN KIRAL
ADNAN KIRAL 2021 年 8 月 2 日
Bjorn Gustavsson
Bjorn Gustavsson 2021 年 8 月 2 日
Happy that it helped.

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2021 年 8 月 2 日
Use the tiledlayout and nexttile functions to create a configurable tiling of plots. The configuration options include:
  • Control over the spacing between the plots and around the edges of the layout
  • An option for a shared title at the top of the layout
  • Options for shared x- and y-axis labels
  • An option to control whether the tiling has a fixed size or variable size that can reflow
For more information, see Combine Multiple Plots.

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by