%%------------------------
%% Plot 
%%------------------------
figure(2); clf; giffig_wide
sax = [min(S) max(S)];
fax = [min(F) max(F)]; pHax = [min(PH) max(PH)]; O2ax = [min(O2) max(O2)];
XL = 'mission time';

subplot(411); plot(mtime,depth,'k'); ylabel('depth'); set(gca,'Ydir','reverse');
xl=get(gca,'xlim'); set(gca,'box','off','YaxisLocation','left','tickdir','out'); 
hold on
P = get(gca,'position'); axes('position',P);
plot(mtime,pitch,'c'); hold on; plot(xl,[0 0],'k--');
set(gca,'YaxisLocation','right','Ycolor','c','box','off','tickdir','out');
ylabel('Pitch'); set(gca,'color','none','Ylim',[min(pitch) max(pitch)]);
set(gca,'xlim',xl);

subplot(412); 
plot(mtime,T,'r'); set(gca,'ylim',[min(T) max(T)]);
ylabel('temperature');
set(gca,'Ycolor','r','box','off','YaxisLocation','left','tickdir','out');
set(gca,'xlim',xl);
P = get(gca,'position'); axes('position',P);
plot(mtime,S,'b'); set(gca,'YaxisLocation','right','Ycolor','b','box','off');
set(gca,'Ylim',sax); ylabel('salinity'); set(gca,'color','none','tickdir','out');
set(gca,'xlim',xl);

subplot(413); plot(mtime,PH,'k'); ylabel('pH'); hold on; set(gca,'Ylim',pHax); 
set(gca,'box','off','YaxisLocation','left','tickdir','out'); set(gca,'xlim',xl);
P = get(gca,'position'); axes('position',P);
plot(mtime,O2,'m'); ylabel('Oxygen (ml/l)'); set(gca,'Ylim',O2ax); 
set(gca,'xlim',xl,'color','none','Yaxislocation','right','Ycolor','m','box','off','tickdir','out');

subplot(414), plot(mtime,F,'g'); 
set(gca,'YaxisLocation','left','Ycolor','g','box','off','tickdir','out');
set(gca,'Ylim',fax); ylabel('fluorometer (volts)'); 
set(gca,'xlim',xl); hold on;
P = get(gca,'position'); axes('position',P)
plot(mtime,OBS,'r'); ylabel('OBS');
xlabel(XL); 
set(gca,'box','off','xlim',xl,'color','none','Yaxislocation','right','Ycolor','r','tickdir','out');

