%% plot decay times

subplot(4,1,3); hold off;
% subplot(2,1,1);
% hold off;
cellList = who('venus20628_cell*');
%numCells = length(cellList)

%n_cutoff = 30;

clear decay*
for i = 1:length(cellList)
    %varSuffix = [num2str(i,'%03d')];
    cellID{i} = cellList{i};
    tmp_data = eval(cellID{i});
    tmp_decay = tmp_data(:,5);
    decay.mean(i) = mean(tmp_decay);
    decay.n(i) = length(tmp_decay);
    decay.stderr(i) = std(tmp_decay)/sqrt(decay.n(i));
    disp([cellID{i},': ',num2str(decay.mean(i)),' +/- ', ...
        num2str(decay.stderr(i)), ' pA', ...
        '   (n=',num2str(decay.n(i)),')']);
end
decay_venus20628(:,1) = decay.mean(decay.n>=n_cutoff);
decay_venus20628(:,2) = decay.stderr(decay.n>=n_cutoff);


cellList = who('venus20629_cell*');
disp('');

%numCells = length(cellList)

clear decay
for i = 1:length(cellList)
    %varSuffix = [num2str(i,'%03d')];
    cellID{i} = cellList{i};
    tmp_data = eval(cellID{i});
    tmp_decay = tmp_data(:,5);
    decay.mean(i) = mean(tmp_decay);
    decay.n(i) = length(tmp_decay);
    decay.stderr(i) = std(tmp_decay)/sqrt(decay.n(i));
    disp([cellID{i},': ',num2str(decay.mean(i)),' +/- ', ...
        num2str(decay.stderr(i)), ' pA', ...
        '   (n=',num2str(decay.n(i)),')']);
end
decay_venus20629(:,1) = decay.mean(decay.n>=n_cutoff);
decay_venus20629(:,2) = decay.stderr(decay.n>=n_cutoff);

errorbar(1:size(decay_venus20628,1),decay_venus20628(:,1),decay_venus20628(:,2),'ro'); hold on;
errorbar([1:size(decay_venus20629,1)]+size(decay_venus20628,1)+1,decay_venus20629(:,1),decay_venus20629(:,2),'bo');
% plot([1,size(decay_venus20628,1)],[mean(decay_venus20628(:,1)) mean(decay_venus20628(:,1))],'r--');
% plot([1,size(decay_venus20629,1)]+size(decay_venus20628,1)+1,[mean(decay_venus20629(:,1)) mean(decay_venus20629(:,1))],'b--');
plot([0.5,size(decay_venus20629,1)+size(decay_venus20628,1)+1.5],[mean(decay_venus20628(:,1)) mean(decay_venus20628(:,1))],'r--');
plot([0.5,size(decay_venus20629,1)+size(decay_venus20628,1)+1.5],[mean(decay_venus20629(:,1)) mean(decay_venus20629(:,1))],'b--');

ylabel('Decay Time (ms)','FontSize',14);