I use the PLOTYY function to create one of the subplots in my figure window by executing the following in the MATLAB Prompt:
t = linspace(-10,10,128).'*1e-12;I = t;I1 = t.^2;w = t;S1 = t;p = t.^2;figure('DefaultAxesFontSize',12,'Position',[0 400 1000 650])subplot(2,2,[1 2])linesubplot(223)[hax,hp(1),hp(2)] = plotyy(w*1e6,S1,w*1e6,p);set(hax,'XLim',[1.062 1.072])set(hax(2),'Position',get(hax(1),'Position'))set(hax(1),'XMinorTick','on','YMinorTick','on')
However, the subplot resulting from the PLOTYY function has two axes that do not align correctly.
Best Answer