MATLAB: PLOTYY Label Vertical Axis

plotyy

figure (7)
plotyy(x1-11100,y1,x2,y2, 'stairs', 'plot')
Is 'stairs' 'plot' really necessary? What do these represent in plotyy?
title('Force vs. Time')
xlabel('Time (s)');
How would I label the left and right vertical axis?

Best Answer

'stairs' in that position instructs plotyy() to call stairs() plot for the first set of data. Use whichever plotting routine is appropriate for your data representation.
To label the two axes independently, record the output of plotyy()
ax = plotyy(x1-11100,y1,x2,y2, 'stairs', 'plot');
Then index result to specify which axis you want
ylabel(ax(1), 'Major Force');
ylabel(ax(2), '2 Star General Force');