MATLAB: Set limit for secondary y-axis

plotyy

Primary Y-axis limits can be set with ylim command.how to set limits for secondary Y-axis??(when ploted with plotyy command)

Best Answer

Use the handle to the second y-axis:
[ax h1 h2] = plotyy(1:10,1:10,1:10,10:-1:1);
ylim(ax(2),[0 pi]);