Combining Two plots with different with the same y axis and different x axis length

1 回表示 (過去 30 日間)
Saeed Almishal
Saeed Almishal 2021 年 3 月 7 日
編集済み: Jorg Woehl 2021 年 3 月 8 日
Hi,
I am plotting two figures with the same y-axis and I am using nexttile. I keep getting them as two boxes with the same area but I want to have them in the following form:
any suggestions on how to do that?
Thank you

回答 (1 件)

Jorg Woehl
Jorg Woehl 2021 年 3 月 8 日
編集済み: Jorg Woehl 2021 年 3 月 8 日
If the widths of your two plot boxes have an integer ratio (such as 4:1), you can use tiledlayout to do this. First create one row of five tiles, then merge the first four tiles for the first plot:
t = tiledlayout(1,5)
nexttile([1,4]) % merge first four tiles in row 1
% plot something
[X,Y,Z] = peaks
imagesc(Z)
nexttile % last tile in row 1
% another plot with the same y axis
imagesc(Z(:,1:10))

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by