You can use ylim
to force limits on the y-axis. For example:
figure(1)
%// Some plotting...
ylim([0 3])
figure(2)
%// Some more plotting
ylim([0 3])
This ensures that the y-axis is limited to the range [0, 3] in both plots. You can do the same for the limits of the x-axis with the command xlim
.
Also note that if you want to set the limits for both axes at once, instead of using xlim
and ylim
(two commands), you can use axis
(one command).