linkaxes axis has bug?

조회 수: 4 (최근 30일)
galaxy
galaxy 2022년 10월 17일
댓글: Jiri Hajek 2022년 10월 17일
Hi all,
I want to linkaxes x axis only for 2 subplot as following.
sub1 = subplot(2, 1, 1);
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
ylabel('Y');
xticks(1:10)
grid on;
sub2 =subplot(2, 1, 2);
yyaxis('left');
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
ylabel('Y1');
yyaxis('right');
plot(randi([2 10],[10,1]), 'r.-', 'LineWidth', 2);
ylabel('Y2');
xlabel('Time[ms]');
grid on;
linkaxes([sub1 sub2],'x');
But when I zoom in plot1, 2y axis of plot2 still zoom in.
Is it right or bug?
Thank you so much
  댓글 수: 1
Jiri Hajek
Jiri Hajek 2022년 10월 17일
Tried your code (in R2022b) and the behaviour is OK, zooming in any axes is reflected in the second as well...

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Axes Appearance에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by