link axes of specific subplots

437 ビュー (過去 30 日間)
Lieke Numan
Lieke Numan 2019 年 2 月 1 日
コメント済み: Stephen Cowen 2023 年 5 月 25 日
I have a subplot of size (8,1). I want to link the x-axis of the first two subplots with eachother (so they'll stay the same when zooming), and the 3rd-8th axes of eachother.
Could you help me?

採用された回答

Luna
Luna 2019 年 2 月 1 日
Hi Lieke,
Try this below:
ax1 = subplot(8,1,1);
% plot something
ax2 = subplot(8,1,2);
% plot something
ax8 = subplot(8,1,8);
% plot something
linkaxes([ax1,ax2],'x');
linkaxes([ax3,ax8],'x'); % where ax1 ... ax8 are your axis handles.
  3 件のコメント
Luna
Luna 2019 年 2 月 4 日
Your welcome :)
Stephen Cowen
Stephen Cowen 2023 年 5 月 25 日
Typically, this works well, until it doesn't. I am getting intermittent crashes when I use linkaxes and zoom or pan in one axis. 9.13.0.2105380 (R2022b) Update 2

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

その他の回答 (0 件)

カテゴリ

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