MATLAB: Plotyy is not working properly??

plotyy

Well I have an application for "plotyy" function, So I find if I ever zoom in anywhere on the plot, one of the axis stick in a zoomed position when you click on "reset to original view". One axis resets but the other does not. I did no modifications to "plotyy" function, so I was wondering if someone out there knows how to fix this issue with "plotyy" or if someone knows why it is doing this. If someone needs code to work with, here is an example:
figure
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
plotyy(x,y1,x,y2,'plot');
To see the problem, simply zoom in and then zoom out or reset with the right click of the mouse! Thanks!

Best Answer

Your code is right, I run it and it works for me with no problem. Besides, it is from matlab documentation, for which it should work properly. I think your problem lies on your machine/system.