try
close(inst_plot);
catch
    fprintf('Already closed');
end

inst_plot=figure;
set(inst_plot,'name','OXYGEN STATS');

t=get(Dhand.Time_Select,'value');
    switch t,
     case 1
        t=1;
      case 2
        t=3;
     case 3
        t=7;
     case 4
        t=100000; 
    end % switch
 
tind=find(Drift.o2(1,:)>=falsenow-t);
subplot(2,1,1);
plot(Drift.o2(1,tind),Drift.o2(2,tind),'r-');
datetick('x');
xlabel('Time','FontWeight','Bold');
ylabel('Volts','FontWeight','Bold');
titl=sprintf('%s O2 Voltage',graphtitle);
title(titl,'FontWeight','Bold');
subplot(2,1,2);
plot(Drift.o2(1,tind),Drift.o2(3,tind),'b-');
datetick('x');
xlabel('Time','FontWeight','Bold');
ylabel('ml/l','FontWeight','Bold');
titl=sprintf('%s SeaWater Oxygen',graphtitle);
title(titl,'FontWeight','Bold');
set(inst_plot,'Position',[3 29 1022 672]);