
function qcWG_plotAll(pos,co2,ctd,ep,met,metw)

% pos = Position;
% co2 = CO2;
% ctd = CTD;
% ep = EP;
% met = MET;
% metw = METw;

% -- 
% Jeff Sevadjian
% Research Technician
% Monterey Bay Aquarium Research Institute
% 7700 Sandholdt Rd
% Moss Landing, CA 95039, USA
% ph: +1 831-775-1888

% Makes a figure similar to the webQC page

%colormap
 myCol = [
   100 100 100; ... %gray
   11 99 160; ... %blue
   255 127 14; ... %orange
   44, 160, 44; ... %green
   50 50 50; ... %dark gray
   134 159 192; ... %lt. blue
   20 20 20] ... %black
   / 255;

%axes param's
 %all axes
  timeAll = [pos(:,1); co2(:,1); ctd(:,1); ep(:,1); met(:,1); metw(:,1)];
  ax.XLim = [min(timeAll) max(timeAll)];
  ax.XTickLabel = [];
  ax.Box = 'off';
 %secondary axes
  ax2.Color = 'none';
  ax2.XAxisLocation = 'top';
  ax2.YAxisLocation = 'right';
  ax2.XTickLabel = [];
 %tertiary axes
  ax3.Color = 'none';
  ax3.XTick = [];
  ax3.YTick = [];
  ax3.YAxisLocation = 'right';
  ax3.XColor = 'none';
  %y-axis for tertiary
   ax4.Color = 'none';
   ax4.XTick = [];
   ax4.YAxisLocation = 'right';
   ax4.XColor = 'none';

%create fig
 figure('Name','All','Units','inches','Position',[0 0 11 8.5]);
 ha = tight_subplot(7,1,0.03,0.05,0.15);

%Position
 axes(ha(1));
 %lon
  plot(pos(:,1),pos(:,2),'.-','Color',myCol(1,:));
  ylabel(['Lon [' char(186) 'E]']);
  set(ha(1),ax,'YColor',myCol(1,:),'YLim',[min(pos(:,2)) max(pos(:,2))]);
 %lat
  ha1a = axes;
  plot(pos(:,1),pos(:,3),'.-','Color',myCol(2,:));
  ylabel(['Lat [' char(186) 'N]']);
  set(ha1a,ax,ax2,'Position',get(ha(1),'Position'),...
    'XTick',get(ha(1),'XTick'),'YColor',myCol(2,:),...
    'YLim',[min(pos(:,3)) max(pos(:,3))]);

%CTD
 axes(ha(2));
 %temp
  plot(ctd(:,1),ctd(:,2),'.-','Color',myCol(2,:));
  ylabel(['T [' char(186) 'C]']);
  set(ha(2),ax,'YColor',myCol(2,:),'YLim',[min(ctd(:,2)) max(ctd(:,2))]);
 %sal
  ha2a = axes;
  plot(ctd(:,1),ctd(:,3),'.-','Color',myCol(3,:));
  ylabel('S');
  set(ha2a,ax,ax2,'Position',get(ha(2),'Position'),...
    'XTick',get(ha(2),'XTick'),'YColor',myCol(3,:),...
    'YLim',[min(ctd(:,3)) max(ctd(:,3))]);
 %o2
  ha2b = axes;
  plot(ctd(:,1),ctd(:,4),'.-','Color',myCol(4,:));
  set(ha2b,ax,ax3,'Position',get(ha(2),'Position'),...
    'YColor',myCol(4,:),'YLim',[min(ctd(:,4)) max(ctd(:,4))]);
  ha2b1 = axes();
  ylabel(['O2 [' char(181) 'mol/kg]']);
  set(ha2b1,ax,ax4,'Position',get(ha(2),'Position') + [0 0 .06 0],...
    'YColor',myCol(4,:),'YLim',get(ha2b,'YLim'));

%pCO2
 axes(ha(3));
  %pH
   plot(co2(:,1),co2(:,2),'.-','Color',myCol(7,:));
   ylabel('pH');
   set(ha(3),ax,'YColor',myCol(7,:));
   try set(ha(3),'YLim',[min(co2(:,2)) max(co2(:,2))]); end
  %pCO2
   ha3a = axes;
   %water
    f = find(~isnan(co2(:,3)));
    plot(co2(f,1),co2(f,3),'.-','Color',myCol(2,:));
    ylabel('pCO2 [ppm]');
    set(ha3a,ax,ax2,'Position',get(ha(3),'Position'),...
      'XTick',get(ha(3),'XTick'),'YColor',myCol(2,:),...
      'NextPlot','add','YLim',[min(min(co2(:,3:4))) max(max(co2(:,3:4)))]);
   %air
    f = find(~isnan(co2(:,4)));
    plot(co2(f,1),co2(f,4),'.-','Color',myCol(6,:));
    clear f;

%Eco-Puck
 axes(ha(4));
  %fluor
   plot(ep(:,1),ep(:,2),'.-','Color',myCol(4,:));
   ylabel(['Fluor [' char(181) 'g/l]']);
   set(ha(4),ax,'YColor',myCol(4,:),'YLim',[min(ep(:,2)) max(ep(:,2))]);
  %bb
   ha4a = axes;
    %470
     plot(ep(:,1),ep(:,3),'.-','Color',myCol(7,:));
     ylabel('bb [1/m]');
     set(ha4a,ax,ax2,'Position',get(ha(4),'Position'),...
       'XTick',get(ha(4),'XTick'),'YColor',myCol(7,:),...
       'NextPlot','add','YLim',[min(min(ep(:,3:4))) max(max(ep(:,3:4)))]);
    %650
     plot(ep(:,1),ep(:,4),'.-','Color',myCol(1,:));

%Wind
 axes(ha(5));
  %dir
   plot(metw(:,1),metw(:,2),'.','Color',myCol(1,:));
   ylabel('Wind Dir');
   set(ha(5),ax,'YColor',myCol(1,:));
   try set(ha(5),'YLim',[min(metw(:,2)) max(metw(:,2))]); end
  %speed
   ha5a = axes;
   plot(metw(:,1),metw(:,3),'.-','Color',myCol(2,:));
   ylabel('Speed [m/s]');
   set(ha5a,ax,ax2,'Position',get(ha(5),'Position'),...
     'XTick',get(ha(5),'XTick'),'YColor',myCol(2,:));
   try set(ha5a,'YLim',[min(metw(:,3)) max(metw(:,3))]); end

%MET
 axes(ha(6));
  %press
   plot(met(:,1),met(:,2),'.-','Color',myCol(1,:));
   ylabel('Press [hPa]');
   set(ha(6),ax,'YColor',myCol(1,:));
   try set(ha(6),'YLim',[min(met(:,2)) max(met(:,2))]); end
  %temp
   ha6a = axes;
   plot(met(:,1),met(:,3),'.-','Color',myCol(2,:));
   ylabel(['Temp [' char(186) 'C]']);
   set(ha6a,ax,ax2,'Position',get(ha(6),'Position'),...
     'XTick',get(ha(6),'XTick'),'YColor',myCol(2,:));
   try set(ha6a,'YLim',[min(met(:,3)) max(met(:,3))]); end

%TagID - to do
 axes(ha(7));
 set(ha(7),ax);
 
%link axes
 linkaxes([ha',ha1a,ha2a,ha2b,ha2b1,ha3a,ha4a,ha5a,ha6a],'x');
 