I've had some problems using 'plotyy' inside a subplot.
I want a subplot with 4 figures and use in each one of them 'plotyy'. I've had some problems because of the axis' scaling, and now that I have resolved this for the first figure, but when I tried to use the same structures for the second figure from the subplot, this 2nd figure is perfect but the first one becomes a plot with only one graph instead of the previous two(so, the first 'plotyy' stops working). For a better understanding of my problem, the code that I've used is:
AXInv = subplot(2,2,1); % Auto-fitted to the figure.
PInv = get(AXInv,'pos'); % Get the position.
delete(AXInv)
[AXInv,H1,H2] = plotyy(h,Inv,h,prod_Inv,'plot');
set(AXInv,'pos',PInv) % Recover the position.
line([0 24],[0 1],'parent',AXInv(1),'Color',[1 1 1]) % Axis is not scaled
axis auto % Numbers on axes are crushing.
set(AXInv(1),'ytickmode','auto') % This is new....
line([0 24],[0 1500],'parent',AXInv(2),'Color',[1 1 1]) % Axis is not scaled
axis auto % Numbers on axes are crushing.
set(AXInv(2),'ytickmode','auto') % This is new....
AXPrim = subplot(2,2,2); % Auto-fitted to the figure.
PPrim = get(AXPrim,'pos'); % Get the position.
delete(AXPrim)
[AXPrim,H1,H2] = plotyy(h,Prim,h,prod_Prim,'plot');
set(AXPrim,'pos',PPrim) % Recover the position.
line([0 24],[0 1],'parent',AXPrim(1),'Color',[1 1 1]) % Axis is not scaled
axis auto % Numbers on axes are crushing.
set(AXPrim(1),'ytickmode','auto') % This is new....
line([0 24],[0 1500],'parent',AXPrim(2),'Color',[1 1 1]) % Axis is not scaled
axis auto % Numbers on axes are crushing.
set(AXPrim(2),'ytickmode','auto') % This is new....
Could anyone help me?
Thanks you in advance!
