%% plot amplitudes

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

n_cutoff = 35;

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


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

%numCells = length(cellList)

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

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

ylabel('Amplitude (pA)','FontSize',14);