I'm trying to make a plot with 2 y-axes and wasn't able to use the yyaxis command since I want to change the uistack afterwards and it doesn't work with this function showhow. Now I have a new problem because of that. When I try to link the 2 axes, the y-scale of the left axis is changed to the values of the right one that are 10 times bigger.
Is there a way to link the axes to be able to "zoom" or change the parts visible without changing the axis values?
ax2 = axes('Position',[0.1300 0.1100 0.7750 0.8150]);
ax1 = axes('Position',[0.1300 0.1100 0.7750 0.8150]);
plot(ax1,[1 5 10],[1 5 10]);
plot(ax2,[1 5 10],[10 50 100]);
ax2.YAxisLocation = 'right';
set(ax1, 'Color', 'None');
ax2.XTick = [];
linkaxes([ax1 ax2]);
Thanks for your help
2 件のコメント
Adam Danz (view profile)
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/489486-link-axes-with-different-y-scales#comment_764353
Alexander von Mach (view profile)
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/489486-link-axes-with-different-y-scales#comment_764631
サインイン to comment.