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

inst_plot=figure;
set(inst_plot,'name','SBE47CT 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.ct(1,:)>=falsenow-t);
subplot(2,1,1);
plot(Drift.ct(1,tind),Drift.ct(2,tind),'r-');
datetick('x');
xlabel('Time','FontWeight','Bold');
ylabel('Celsius','FontWeight','Bold');
titl=sprintf('%s CT Temperature',graphtitle);
title(titl,'FontWeight','Bold');
subplot(2,1,2);
plot(Drift.ct(1,tind),Drift.ct(3,tind),'g-');
datetick('x');
xlabel('Time','FontWeight','Bold');
ylabel('PSU','FontWeight','Bold');
titl=sprintf('%s CT Salinity',graphtitle);
title(titl,'FontWeight','Bold');

set(inst_plot,'Position',[3 29 1022 672]);