clear;
load miniDB;

subset.amplitude = amplitude(decay<=6);
subset.area = area(decay<=6);
subset.bath = bath(decay<=6);
subset.culture = culture(decay<=6);
subset.decay = decay(decay<=6);
subset.div = div(decay<=6);
subset.fid = fid(decay<=6);
subset.rise = rise(decay<=6);
subset.time = time(decay<=6);
subset.treatment = treatment(decay<=6);

fidlist = unique(subset.fid);

close all;
for i = 1:length(fidlist)
    %keyboard;
    amp_tmp = subset.amplitude(strcmp(fidlist{i},subset.fid));
    tre_tmp = subset.treatment(strcmp(fidlist{i},subset.fid));
    tre_tmp = unique(tre_tmp);
    switch char(tre_tmp)
        case 'CNQX'
            col = [1 0 0];
        case 'TTX'
            col = [0 0.3 0.8];
        case 'control'
            col = [0 0 0];
        otherwise
            col = [0.5 0.5 0.5];
    end
    plot(ones(size(amp_tmp))*i*0.01+0.001*randn(size(amp_tmp)),amp_tmp,'.','MarkerSize',2,'Color',col);
    hold on;
    %ind = strfind(fidlist{i},'_');
    %fidlabel{i} = fidlist{i}(1:ind(1)-1);
    fidlabel{i} = subset.culture(strcmp(fidlist{i},subset.fid));
end

axis([0 (i+1)*0.01 0 150])
set(gca,'XTick',[1:length(fidlist)]*0.01,'XTickLabel',fidlabel);
rotateticklabel(gca);

