필터 지우기
필터 지우기

link axes of specific subplots

조회 수: 521 (최근 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 CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by