yyaxis change ylim for both axes

87 views (last 30 days)
I would like to change the ylim of the left yaxis. You can see that the ylim entry has no effect at all. I can only change the right side of the yyaxis plot. I appraciate your advice.
Best regards
fig = figure (1);
set(fig, 'Units', 'normalized', 'Position', [0.2, 0.1, 0.5, 0.3]);
%%Plot data
%First subplot
ax1 = subplot(121)
x1 = linspace(1, 1000);
y11 = x1.^2;
y12 = x1;
yyaxis left
ylim([1, 100]); % Has no effect. Why?
grid on
yyaxis right
%Second subplot
ax2 = subplot(122);
grid on;

Accepted Answer

Walter Roberson
Walter Roberson on 23 Nov 2017
Henrik Schädlich
Henrik Schädlich on 24 Nov 2017
Of course. I placed the wrong variable. ^^ Thank you.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by