linkaxes axis has bug?

1 回表示 (過去 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 Center および File ExchangeLine Plots についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by