フィルターのクリア

Can I shift the position of a tile in tiledlayout to be skewed?

27 ビュー (過去 30 日間)
Astrid Fanger Jakobsen
Astrid Fanger Jakobsen 2020 年 10 月 12 日
回答済み: David Szwer 2021 年 3 月 16 日
Is it possible to get a layout like the picture below using tiledlayout?
For the plots below I've used subplot(3,2,5.5) for the last plot. I would like to use tiledlayout instead, as there I can remove the white space between the plots.
Is there a way to get the following layout and remove rebundant white space between the subplots?
  1 件のコメント
VBBV
VBBV 2020 年 10 月 12 日
編集済み: VBBV 2020 年 10 月 12 日
%if true
% code
% end
t = tiledlayout(3,2,'TileSpacing','none')
You can also use padding to make the figure layout small as
% if true
% code
% end
t =
tiledlayout(3,2,'Padding','none')

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

採用された回答

Matt J
Matt J 2020 年 10 月 12 日
編集済み: Matt J 2020 年 10 月 12 日
I think that such a layout violates the definition of "tiled" and therefore will not be possible with tiledlayout, however this File Exchange file,
gives you all the same flexibility as subplot, but in addition allows you to control inter-plot spacing. E.g.,
subaxis(2,2,1,1); plot(1:5)
subaxis(2,2,2,1); plot(1:5)
subaxis(2,2,1.5,2); plot(1:5)

その他の回答 (1 件)

David Szwer
David Szwer 2021 年 3 月 16 日
The solution is to set up tiledlayout with double the number of rows and columns you need, and create each axes as a 2×2 square.
tiledlayout(6,4, 'TileSpacing','None', 'Padding','None')
% The spacing and padding can be 'Normal', 'Compact' or 'None'.
% Create the first four axes - they go in their default positions.
nexttile([2,2])
nexttile([2,2])
nexttile([2,2])
nexttile([2,2])
% The tiles of tiledlayout are numbered across, then down. The top-left
% corner of your fifth axes would be tile 17, except that you want it in
% the middle of the row. So you must set the top-left corner to be in cell
% 18.
nexttile(18,[2,2])
This should give the arrangement you want.

カテゴリ

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