function stsd_grid_plotter_irreg_spaced_probabilities(plain_extractedmatrix,conjoined_filename,hy,epoch_dividers,parameter_colors,stsd_parameters,number_of_IPIs,detection_criterion_matrix)
%this script's job is to indicate number of pulses that were successful in a given condition over the total number that could have been -- a frequentist notion of probability
%the point is to look at short-term plasticity as a binary variable (success or failure) for single synapse experiments,
%to see how pulse #, interpulse interval, and epoch (that is, long-term change) affect release
%in this binary (or near-binary) situation, we can look at *the release dependence of short-term depression* to better understand mechanisms of short-term plasticity
%acausal probabilities (e.g., Pr_o given that _b was successful) are shown as well, a) to get a sense of how much random variation is 'normal',
%b) as controls to show that no artifacts (e.g. drift) affect measurements, and c) to see if anything unexpected, like branch failure, is involved

%SD_based_defintion_of_failure=1; %to be meaningful, requires that Q_between_thresholds was active during call to create_storage_matrices
%simple_threshold_based_definition_of_failure=bitcmp(SD_based_defintion_of_failure,1);
failure_definition='template' %'SD' or 'threshold' or 'template'
f_s=15;     %font_size
f_w='bold'; %font_weight
text_interval=1;    %if 1, will put the interval on the data points when plotting, otherwise will put epoch

if ~isempty(epoch_dividers),trials_this_epoch=[1:epoch_dividers(1)-.5];else trials_this_epoch=1:size(plain_extractedmatrix,2);end
for epoch=1:length(epoch_dividers)+1
    parameter=epoch;    %used a) to fill the parameter expectation of innerportion.m, below, and b) to assign the symbols different colors for each epoch
    switch lower(failure_definition)
        case 'sd'
            trials_this_epoch_where_first_pulse_succeeded=trials_this_epoch(find(~isnan(plain_extractedmatrix(number_of_IPIs+1,trials_this_epoch,2))));    %# of SDs from baseline was set in create_storage_matrices
            trials_this_epoch_where_second_pulse_succeeded=trials_this_epoch(find(~isnan(plain_extractedmatrix(number_of_IPIs+2,trials_this_epoch,2))));
            trials_this_epoch_where_third_pulse_succeeded=trials_this_epoch(find(~isnan(plain_extractedmatrix(number_of_IPIs+3,trials_this_epoch,2))));
        case 'threshold'
            trials_this_epoch_where_first_pulse_succeeded=trials_this_epoch(find(plain_extractedmatrix(number_of_IPIs+1,trials_this_epoch,1)>3));  %if selecting by threshold, need to determine the threshold
            trials_this_epoch_where_second_pulse_succeeded=trials_this_epoch(find(plain_extractedmatrix(number_of_IPIs+2,trials_this_epoch,1)>3)); 
            trials_this_epoch_where_third_pulse_succeeded=trials_this_epoch(find(plain_extractedmatrix(number_of_IPIs+3,trials_this_epoch,1)>3));
        case 'template'
            detec_rows=size(detection_criterion_matrix,1);detec_seg=detec_rows/3;
            trials_this_epoch_where_first_pulse_succeeded=trials_this_epoch(find(max(detection_criterion_matrix(1:detec_seg,trials_this_epoch))> 1.5));
            trials_this_epoch_where_second_pulse_succeeded=trials_this_epoch(find(max(detection_criterion_matrix(detec_seg+1:2*detec_seg,trials_this_epoch))>1.5));
            trials_this_epoch_where_third_pulse_succeeded=trials_this_epoch(find(max(detection_criterion_matrix(2*detec_seg+1:end,trials_this_epoch))>1.5));
    end
%     if SD_based_defintion_of_failure
%         trials_this_epoch_where_first_pulse_succeeded=trials_this_epoch(find(~isnan(plain_extractedmatrix(number_of_IPIs+1,trials_this_epoch,2))));    %# of SDs from baseline was set in create_storage_matrices
%         trials_this_epoch_where_second_pulse_succeeded=trials_this_epoch(find(~isnan(plain_extractedmatrix(number_of_IPIs+2,trials_this_epoch,2))));
%         trials_this_epoch_where_third_pulse_succeeded=trials_this_epoch(find(~isnan(plain_extractedmatrix(number_of_IPIs+3,trials_this_epoch,2))));
% 	elseif simple_threshold_based_definition_of_failure
%         trials_this_epoch_where_first_pulse_succeeded=trials_this_epoch(find(plain_extractedmatrix(number_of_IPIs+1,trials_this_epoch,1)>3));  %if selecting by threshold, need to determine the threshold
%         trials_this_epoch_where_second_pulse_succeeded=trials_this_epoch(find(plain_extractedmatrix(number_of_IPIs+2,trials_this_epoch,1)>3)); 
%         trials_this_epoch_where_third_pulse_succeeded=trials_this_epoch(find(plain_extractedmatrix(number_of_IPIs+3,trials_this_epoch,1)>3));
%     end
    trials_this_epoch_where_first_pulse_failed=trials_this_epoch;trials_this_epoch_where_first_pulse_failed(trials_this_epoch_where_first_pulse_succeeded-(trials_this_epoch(1)-1))=[];
    trials_this_epoch_where_second_pulse_failed=trials_this_epoch;trials_this_epoch_where_second_pulse_failed(trials_this_epoch_where_second_pulse_succeeded-(trials_this_epoch(1)-1))=[];
    trials_this_epoch_where_third_pulse_failed=trials_this_epoch;trials_this_epoch_where_third_pulse_failed(trials_this_epoch_where_third_pulse_succeeded-(trials_this_epoch(1)-1))=[];
    
    if ~isempty(epoch_dividers),epoch_shift=-1/6+((epoch-1)/(length(epoch_dividers)))*(2/6);else epoch_shift=0; end    %this is here to x-shift the plotted data by epoch a bit to make it more visible
    handlez=[];     %used for optimizing the axes of subplots, when all is said and done
    figure(60), set(gcf,'position',[1 31 1600 1094])
    for interval=(length(hy)+1):-1:1    %the plus one is for the non-interval-specific situations
        if interval<length(hy)+1,trials_this_epoch_having_this_interval=trials_this_epoch(find(plain_extractedmatrix(1,trials_this_epoch,1)==hy(interval)));
        else trials_this_epoch_having_this_interval=trials_this_epoch;end
        
        %first row:  Pr(_o)
        %first column:  all trials this epoch
        handlez(1)=subplot(3,9,1);title('all trials','fontsize',f_s,'fontweight',f_w),ylabel('Pr(o)','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            valid_values=length(trials_this_epoch_where_first_pulse_succeeded)/length(trials_this_epoch);x_val=0;
        else trials_with_successful_first_pulse_then_correct_interval=[]; 
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_having_this_interval)
                            if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_having_this_interval(j),
                                trials_with_successful_first_pulse_then_correct_interval=[trials_with_successful_first_pulse_then_correct_interval trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trials_with_successful_first_pulse_then_correct_interval)/length(trials_this_epoch_having_this_interval);x_val=log2(hy(interval));            
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch),f_s,f_w)
        text(0,1.3,conjoined_filename)
        
        %second column:  when _a succeeds
        handlez(2)=subplot(3,9,2);title('a+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),
            trls_first_puls_yes_then_second_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_second_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_succeeded(i)== trials_this_epoch_where_second_pulse_succeeded(j),
                        trls_first_puls_yes_then_second_puls_yes=[trls_first_puls_yes_then_second_puls_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_second_puls_yes)/length(trials_this_epoch_where_second_pulse_succeeded);x_val=0;
        else
            trials_with_correct_interval_and_successful_second_pulse=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trials_this_epoch_where_second_pulse_succeeded)
                            if trials_this_epoch_having_this_interval(i)==trials_this_epoch_where_second_pulse_succeeded(j)
                                trials_with_correct_interval_and_successful_second_pulse=[trials_with_correct_interval_and_successful_second_pulse trials_this_epoch_having_this_interval(i)];end,end,end
            trls_first_puls_yes_then_rt_interval_then_second_puls_yes=[];  
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_successful_second_pulse)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_with_correct_interval_and_successful_second_pulse(j)
                        trls_first_puls_yes_then_rt_interval_then_second_puls_yes=[trls_first_puls_yes_then_rt_interval_then_second_puls_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_rt_interval_then_second_puls_yes)/length(trials_with_correct_interval_and_successful_second_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_second_pulse_succeeded),f_s,f_w)
        
        %third column:  when _a fails
        handlez(3)=subplot(3,9,3);title('a-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_yes_then_second_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_second_pulse_failed)
                    if trials_this_epoch_where_first_pulse_succeeded(i)== trials_this_epoch_where_second_pulse_failed(j),
                        trls_first_puls_yes_then_second_puls_no=[trls_first_puls_yes_then_second_puls_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_second_puls_no)/length(trials_this_epoch_where_second_pulse_failed);x_val=0;
        else
            trials_with_correct_interval_and_failed_second_pulse=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trials_this_epoch_where_second_pulse_failed);
                    if trials_this_epoch_having_this_interval(i)==trials_this_epoch_where_second_pulse_failed(j)
                        trials_with_correct_interval_and_failed_second_pulse=[trials_with_correct_interval_and_failed_second_pulse trials_this_epoch_having_this_interval(i)];end,end,end
           
            trls_first_puls_yes_then_rt_interval_then_second_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_failed_second_pulse)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_with_correct_interval_and_failed_second_pulse(j)
                        trls_first_puls_yes_then_rt_interval_then_second_puls_no=[trls_first_puls_yes_then_rt_interval_then_second_puls_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_rt_interval_then_second_puls_no)/length(trials_with_correct_interval_and_failed_second_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_second_pulse_failed),f_s,f_w)
        
        %fourth column:  when _b succeeds
        handlez(4)=subplot(3,9,4);title('b+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),
            trls_first_puls_yes_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_first_puls_yes_then_third_puls_yes=[trls_first_puls_yes_then_third_puls_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_third_puls_yes)/length(trials_this_epoch_where_third_pulse_succeeded);x_val=0;
        else
            trials_with_correct_interval_and_successful_third_pulse=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_having_this_interval(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trials_with_correct_interval_and_successful_third_pulse=[trials_with_correct_interval_and_successful_third_pulse trials_this_epoch_having_this_interval(i)];end,end,end
            
            trls_first_puls_yes_then_rt_interval_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_successful_third_pulse)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_with_correct_interval_and_successful_third_pulse(j)
                        trls_first_puls_yes_then_rt_interval_then_third_puls_yes=[trls_first_puls_yes_then_rt_interval_then_third_puls_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_rt_interval_then_third_puls_yes)/length(trials_with_correct_interval_and_successful_third_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_third_pulse_succeeded),f_s,f_w)
        
        %fifth column:  when _b fails
        handlez(5)=subplot(3,9,5);title('b-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_yes_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trls_first_puls_yes_then_third_puls_no=[trls_first_puls_yes_then_third_puls_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_third_puls_no)/length(trials_this_epoch_where_third_pulse_failed);x_val=0;
        else
            trials_with_correct_interval_and_failed_third_pulse=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_having_this_interval(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trials_with_correct_interval_and_failed_third_pulse=[trials_with_correct_interval_and_failed_third_pulse trials_this_epoch_having_this_interval(i)];end,end,end
                        
            trls_first_puls_yes_then_rt_interval_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_failed_third_pulse)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_with_correct_interval_and_failed_third_pulse(j)
                        trls_first_puls_yes_then_rt_interval_then_third_puls_no=[trls_first_puls_yes_then_rt_interval_then_third_puls_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_rt_interval_then_third_puls_no)/length(trials_with_correct_interval_and_failed_third_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_third_pulse_failed),f_s,f_w)
        
        %sixth column:  a+ b+
        handlez(6)=subplot(3,9,6);title('a+ b+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_second_puls_yes_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_second_puls_yes_then_third_puls_yes=[trls_second_puls_yes_then_third_puls_yes trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            
            first_yes_second_yes_third_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trls_second_puls_yes_then_third_puls_yes)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trls_second_puls_yes_then_third_puls_yes(j)
                        first_yes_second_yes_third_yes=[first_yes_second_yes_third_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_yes_third_yes)/length(trls_second_puls_yes_then_third_puls_yes);x_val=0;
        else
            rt_interval_second_yes_third_yes=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_second_puls_yes_then_third_puls_yes)
                    if trials_this_epoch_having_this_interval(i)==trls_second_puls_yes_then_third_puls_yes(j)
                        rt_interval_second_yes_third_yes=[rt_interval_second_yes_third_yes trials_this_epoch_having_this_interval(i)];end,end,end
            
            first_yes_rt_int_second_yes_third_yes=[];
            for i=1:length(first_yes_second_yes_third_yes)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_yes_second_yes_third_yes(i)==trials_this_epoch_having_this_interval(j)
                        first_yes_rt_int_second_yes_third_yes=[first_yes_rt_int_second_yes_third_yes first_yes_second_yes_third_yes(i)];end,end,end        
            valid_values=length(first_yes_rt_int_second_yes_third_yes)/length(rt_interval_second_yes_third_yes);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_second_puls_yes_then_third_puls_yes),f_s,f_w)
        
        %seventh column:  a+ b-
        handlez(7)=subplot(3,9,7);title('a+ b-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_second_puls_yes_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trls_second_puls_yes_then_third_puls_no=[trls_second_puls_yes_then_third_puls_no trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            first_yes_second_yes_third_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trls_second_puls_yes_then_third_puls_no)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trls_second_puls_yes_then_third_puls_no(j)
                        first_yes_second_yes_third_no=[first_yes_second_yes_third_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_yes_third_no)/length(trls_second_puls_yes_then_third_puls_no);x_val=0;
        else
            rt_interval_second_yes_third_no=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_second_puls_yes_then_third_puls_no)
                    if trials_this_epoch_having_this_interval(i)==trls_second_puls_yes_then_third_puls_no(j)
                        rt_interval_second_yes_third_no=[rt_interval_second_yes_third_no trials_this_epoch_having_this_interval(i)];end,end,end
            first_yes_rt_int_second_yes_third_no=[];
            for i=1:length(first_yes_second_yes_third_no)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_yes_second_yes_third_no(i)==trials_this_epoch_having_this_interval(j)
                        first_yes_rt_int_second_yes_third_no=[first_yes_rt_int_second_yes_third_no first_yes_second_yes_third_no(i)];end,end,end      
            valid_values=length(first_yes_rt_int_second_yes_third_no)/length(rt_interval_second_yes_third_no);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_second_puls_yes_then_third_puls_no),f_s,f_w)
        
        %eighth column:  a- b+
        handlez(8)=subplot(3,9,8);title('a- b+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_second_puls_no_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_second_pulse_failed)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_where_second_pulse_failed(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_second_puls_no_then_third_puls_yes=[trls_second_puls_no_then_third_puls_yes trials_this_epoch_where_second_pulse_failed(i)];end,end,end
            first_yes_second_no_third_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trls_second_puls_no_then_third_puls_yes)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trls_second_puls_no_then_third_puls_yes(j)
                        first_yes_second_no_third_yes=[first_yes_second_no_third_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_no_third_yes)/length(trls_second_puls_no_then_third_puls_yes);x_val=0;
        else
           rt_interval_second_no_third_yes=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_second_puls_no_then_third_puls_yes)
                    if trials_this_epoch_having_this_interval(i)==trls_second_puls_no_then_third_puls_yes(j)
                        rt_interval_second_no_third_yes=[rt_interval_second_no_third_yes trials_this_epoch_having_this_interval(i)];end,end,end
            first_yes_rt_int_second_no_third_yes=[];
            for i=1:length(first_yes_second_no_third_yes)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_yes_second_no_third_yes(i)==trials_this_epoch_having_this_interval(j)
                        first_yes_rt_int_second_no_third_yes=[first_yes_rt_int_second_no_third_yes first_yes_second_no_third_yes(i)];end,end,end      
            valid_values=length(first_yes_rt_int_second_no_third_yes)/length(rt_interval_second_no_third_yes);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_second_puls_no_then_third_puls_yes),f_s,f_w)
        
        %ninth column:  a- b-
        handlez(9)=subplot(3,9,9);title('a- b-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_second_puls_no_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_second_pulse_failed)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_where_second_pulse_failed(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trls_second_puls_no_then_third_puls_no=[trls_second_puls_no_then_third_puls_no trials_this_epoch_where_second_pulse_failed(i)];end,end,end
            first_yes_second_no_third_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trls_second_puls_no_then_third_puls_no)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trls_second_puls_no_then_third_puls_no(j)
                        first_yes_second_no_third_no=[first_yes_second_no_third_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_no_third_no)/length(trls_second_puls_no_then_third_puls_no);x_val=0;
        else
           rt_interval_second_no_third_no=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_second_puls_no_then_third_puls_no)
                    if trials_this_epoch_having_this_interval(i)==trls_second_puls_no_then_third_puls_no(j)
                        rt_interval_second_no_third_no=[rt_interval_second_no_third_no trials_this_epoch_having_this_interval(i)];end,end,end
            first_yes_rt_int_second_no_third_no=[];
            for i=1:length(first_yes_second_no_third_no)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_yes_second_no_third_no(i)==trials_this_epoch_having_this_interval(j)
                        first_yes_rt_int_second_no_third_no=[first_yes_rt_int_second_no_third_no first_yes_second_no_third_no(i)];end,end,end      
            valid_values=length(first_yes_rt_int_second_no_third_no)/length(rt_interval_second_no_third_no);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_second_puls_no_then_third_puls_no),f_s,f_w)
        
        %second row:  Pr(_a)
        %first column:  all trials this epoch
        handlez(10)=subplot(3,9,10);title('all trials','fontsize',f_s,'fontweight',f_w),ylabel('Pr(a)','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),valid_values=length(trials_this_epoch_where_second_pulse_succeeded)/length(trials_this_epoch);x_val=0;  %
        else trials_with_correct_interval_then_successful_second_pulse=[]; 
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_this_epoch_having_this_interval)
                            if trials_this_epoch_where_second_pulse_succeeded(i)==trials_this_epoch_having_this_interval(j),
                                trials_with_correct_interval_then_successful_second_pulse=[trials_with_correct_interval_then_successful_second_pulse trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(trials_with_correct_interval_then_successful_second_pulse)/length(trials_this_epoch_having_this_interval);x_val=log2(hy(interval));            
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch),f_s,f_w)
        
        %second column:  when _o succeeds
        handlez(11)=subplot(3,9,11);title('o+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),
            valid_values=length(trls_first_puls_yes_then_second_puls_yes)/length(trials_this_epoch_where_first_pulse_succeeded);x_val=0;
        else
            trls_first_puls_yes_then_rt_interval_then_second_puls_yes=[];  
            for i=1:length(trials_with_successful_first_pulse_then_correct_interval)
                for j=1:length(trials_this_epoch_where_second_pulse_succeeded)
                    if trials_with_successful_first_pulse_then_correct_interval(i)==trials_this_epoch_where_second_pulse_succeeded(j)
                        trls_first_puls_yes_then_rt_interval_then_second_puls_yes=[trls_first_puls_yes_then_rt_interval_then_second_puls_yes trials_with_successful_first_pulse_then_correct_interval(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_rt_interval_then_second_puls_yes)/length(trials_with_successful_first_pulse_then_correct_interval);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_first_pulse_succeeded),f_s,f_w)
        
        %third column:  when _o fails
        handlez(12)=subplot(3,9,12);title('o-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_no_then_second_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_failed)
                for j=1:length(trials_this_epoch_where_second_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_failed(i)==trials_this_epoch_where_second_pulse_succeeded(j)
                        trls_first_puls_no_then_second_puls_yes=[trls_first_puls_no_then_second_puls_yes trials_this_epoch_where_first_pulse_failed(i)];end,end,end
            valid_values=length(trls_first_puls_no_then_second_puls_yes)/length(trials_this_epoch_where_first_pulse_failed);x_val=0;
        else
            trials_with_correct_interval_and_failed_first_pulse=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trials_this_epoch_where_first_pulse_failed);
                    if trials_this_epoch_having_this_interval(i)==trials_this_epoch_where_first_pulse_failed(j)
                        trials_with_correct_interval_and_failed_first_pulse=[trials_with_correct_interval_and_failed_first_pulse trials_this_epoch_having_this_interval(i)];end,end,end
           
            trls_first_puls_no_then_rt_interval_then_second_puls_yes=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_failed_first_pulse)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_with_correct_interval_and_failed_first_pulse(j)
                        trls_first_puls_no_then_rt_interval_then_second_puls_yes=[trls_first_puls_no_then_rt_interval_then_second_puls_yes trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_no_then_rt_interval_then_second_puls_yes)/length(trials_with_correct_interval_and_failed_first_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_first_pulse_failed),f_s,f_w)
        
        %fourth column:  when _b succeeds
        handlez(13)=subplot(3,9,13);title('b+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),
            trls_second_puls_yes_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_second_puls_yes_then_third_puls_yes=[trls_second_puls_yes_then_third_puls_yes trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_second_puls_yes_then_third_puls_yes)/length(trials_this_epoch_where_third_pulse_succeeded);x_val=0;
        else
            trls_rt_interval_then_second_puls_yes_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_successful_third_pulse)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_with_correct_interval_and_successful_third_pulse(j)
                        trls_rt_interval_then_second_puls_yes_then_third_puls_yes=[trls_rt_interval_then_second_puls_yes_then_third_puls_yes trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_rt_interval_then_second_puls_yes_then_third_puls_yes)/length(trials_with_correct_interval_and_successful_third_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_third_pulse_succeeded),f_s,f_w)
        
        %fifth column:  when _b fails
        handlez(14)=subplot(3,9,14);title('b-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_second_puls_yes_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trls_second_puls_yes_then_third_puls_no=[trls_second_puls_yes_then_third_puls_no trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_second_puls_yes_then_third_puls_no)/length(trials_this_epoch_where_third_pulse_failed);x_val=0;
        else
            trls_rt_interval_then_second_puls_yes_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_failed_third_pulse)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trials_with_correct_interval_and_failed_third_pulse(j)
                        trls_rt_interval_then_second_puls_yes_then_third_puls_no=[trls_rt_interval_then_second_puls_yes_then_third_puls_no trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_rt_interval_then_second_puls_yes_then_third_puls_no)/length(trials_with_correct_interval_and_failed_third_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_third_pulse_failed),f_s,f_w)
        
        %sixth column:  o+ b+
        handlez(15)=subplot(3,9,15);title('o+ b+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_yes_and_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_first_puls_yes_and_third_puls_yes=[trls_first_puls_yes_and_third_puls_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_yes_third_yes)/length(trls_first_puls_yes_and_third_puls_yes);x_val=0;
        else
            first_yes_rt_interval_third_yes=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_yes_and_third_puls_yes)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_yes_and_third_puls_yes(j)
                        first_yes_rt_interval_third_yes=[first_yes_rt_interval_third_yes trials_this_epoch_having_this_interval(i)];end,end,end      
            valid_values=length(first_yes_rt_int_second_yes_third_yes)/length(first_yes_rt_interval_third_yes);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_yes_and_third_puls_yes),f_s,f_w)
        
        %seventh column:  o+ b-
        handlez(16)=subplot(3,9,16);title('o+ b-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_yes_then_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trls_first_puls_yes_then_third_puls_no=[trls_first_puls_yes_then_third_puls_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_yes_third_no)/length(trls_first_puls_yes_then_third_puls_no);x_val=0;
        else
            first_yes_rt_interval_third_no=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_yes_then_third_puls_no)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_yes_then_third_puls_no(j)
                        first_yes_rt_interval_third_no=[first_yes_rt_interval_third_no trials_this_epoch_having_this_interval(i)];end,end,end
            valid_values=length(first_yes_rt_int_second_yes_third_no)/length(first_yes_rt_interval_third_no);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_yes_then_third_puls_no),f_s,f_w)
        
        %eighth column:  o- b+
        handlez(17)=subplot(3,9,17);title('o- b+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_no_and_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_failed)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_failed(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_first_puls_no_and_third_puls_yes=[trls_first_puls_no_and_third_puls_yes trials_this_epoch_where_first_pulse_failed(i)];end,end,end
            first_no_second_yes_third_yes=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trls_first_puls_no_and_third_puls_yes)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trls_first_puls_no_and_third_puls_yes(j)
                        first_no_second_yes_third_yes=[first_no_second_yes_third_yes trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(first_no_second_yes_third_yes)/length(trls_first_puls_no_and_third_puls_yes);x_val=0;
        else
           first_no_rt_interval_third_yes=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_no_and_third_puls_yes)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_no_and_third_puls_yes(j)
                        first_no_rt_interval_third_yes=[first_no_rt_interval_third_yes trials_this_epoch_having_this_interval(i)];end,end,end
            first_no_rt_int_second_yes_third_yes=[];
            for i=1:length(first_no_second_yes_third_yes)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_no_second_yes_third_yes(i)==trials_this_epoch_having_this_interval(j)
                        first_no_rt_int_second_yes_third_yes=[first_no_rt_int_second_yes_third_yes first_no_second_yes_third_yes(i)];end,end,end      
            valid_values=length(first_no_rt_int_second_yes_third_yes)/length(first_no_rt_interval_third_yes);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_no_and_third_puls_yes),f_s,f_w)
        
        %ninth column:  o- b-
        handlez(18)=subplot(3,9,18);title('o- b-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_no_and_third_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_failed)
                for j=1:length(trials_this_epoch_where_third_pulse_failed)
                    if trials_this_epoch_where_first_pulse_failed(i)==trials_this_epoch_where_third_pulse_failed(j)
                        trls_first_puls_no_and_third_puls_no=[trls_first_puls_no_and_third_puls_no trials_this_epoch_where_first_pulse_failed(i)];end,end,end
            first_no_second_yes_third_no=[];
            for i=1:length(trials_this_epoch_where_second_pulse_succeeded)
                for j=1:length(trls_first_puls_no_and_third_puls_no)
                    if trials_this_epoch_where_second_pulse_succeeded(i)==trls_first_puls_no_and_third_puls_no(j)
                        first_no_second_yes_third_no=[first_no_second_yes_third_no trials_this_epoch_where_second_pulse_succeeded(i)];end,end,end
            valid_values=length(first_no_second_yes_third_no)/length(trls_first_puls_no_and_third_puls_no);x_val=0;
        else
           first_no_rt_interval_third_no=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_no_and_third_puls_no)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_no_and_third_puls_no(j)
                        first_no_rt_interval_third_no=[first_no_rt_interval_third_no trials_this_epoch_having_this_interval(i)];end,end,end
            first_no_rt_int_second_yes_third_no=[];
            for i=1:length(first_no_second_yes_third_no)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_no_second_yes_third_no(i)==trials_this_epoch_having_this_interval(j)
                        first_no_rt_int_second_yes_third_no=[first_no_rt_int_second_yes_third_no first_no_second_yes_third_no(i)];end,end,end      
            valid_values=length(first_no_rt_int_second_yes_third_no)/length(first_no_rt_interval_third_no);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_no_and_third_puls_no),f_s,f_w)
        
        %third row:  Pr(_b)
        %first column:  all trials this epoch
        handlez(19)=subplot(3,9,19);title('all trials','fontsize',f_s,'fontweight',f_w),ylabel('Pr(b)','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),valid_values=length(trials_this_epoch_where_third_pulse_succeeded)/length(trials_this_epoch);x_val=0;  %
        else trials_with_correct_interval_then_successful_third_pulse=[]; 
            for i=1:length(trials_this_epoch_where_third_pulse_succeeded)
                for j=1:length(trials_this_epoch_having_this_interval)
                            if trials_this_epoch_where_third_pulse_succeeded(i)==trials_this_epoch_having_this_interval(j),
                                trials_with_correct_interval_then_successful_third_pulse=[trials_with_correct_interval_then_successful_third_pulse trials_this_epoch_where_third_pulse_succeeded(i)];end,end,end
            valid_values=length(trials_with_correct_interval_then_successful_third_pulse)/length(trials_this_epoch_having_this_interval);x_val=log2(hy(interval));                    
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch),f_s,f_w)
        
        %second column:  when _o succeeds
        handlez(20)=subplot(3,9,20);title('o+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),
            valid_values=length(trls_first_puls_yes_then_third_puls_yes)/length(trials_this_epoch_where_first_pulse_succeeded);x_val=0;
        else
            trls_first_puls_yes_then_rt_interval_and_third_puls_yes=[];  
            for i=1:length(trials_with_successful_first_pulse_then_correct_interval)
                for j=1:length(trials_this_epoch_where_third_pulse_succeeded)
                    if trials_with_successful_first_pulse_then_correct_interval(i)==trials_this_epoch_where_third_pulse_succeeded(j)
                        trls_first_puls_yes_then_rt_interval_and_third_puls_yes=[trls_first_puls_yes_then_rt_interval_and_third_puls_yes trials_with_successful_first_pulse_then_correct_interval(i)];end,end,end
            valid_values=length(trls_first_puls_yes_then_rt_interval_and_third_puls_yes)/length(trials_with_successful_first_pulse_then_correct_interval);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_first_pulse_succeeded),f_s,f_w)
        
        %third column:  when _o fails
        handlez(21)=subplot(3,9,21);title('o-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            valid_values=length(trls_first_puls_no_and_third_puls_yes)/length(trials_this_epoch_where_first_pulse_failed);x_val=0;
        else
            trls_first_puls_no_then_rt_interval_and_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_third_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_failed_first_pulse)
                    if trials_this_epoch_where_third_pulse_succeeded(i)==trials_with_correct_interval_and_failed_first_pulse(j)
                        trls_first_puls_no_then_rt_interval_and_third_puls_yes=[trls_first_puls_no_then_rt_interval_and_third_puls_yes trials_this_epoch_where_third_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_first_puls_no_then_rt_interval_and_third_puls_yes)/length(trials_with_correct_interval_and_failed_first_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_first_pulse_failed),f_s,f_w)
        
        %fourth column:  when _a succeeds
        handlez(22)=subplot(3,9,22);title('a+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy),
            valid_values=length(trls_second_puls_yes_then_third_puls_yes)/length(trials_this_epoch_where_second_pulse_succeeded);x_val=0;
        else
            valid_values=length(trls_rt_interval_then_second_puls_yes_then_third_puls_yes)/length(trials_with_correct_interval_and_successful_second_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_second_pulse_succeeded),f_s,f_w)
        
        %fifth column:  when _a fails
        handlez(23)=subplot(3,9,23);title('a-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_second_puls_no_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_third_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_second_pulse_failed)
                    if trials_this_epoch_where_third_pulse_succeeded(i)==trials_this_epoch_where_second_pulse_failed(j)
                        trls_second_puls_no_then_third_puls_yes=[trls_second_puls_no_then_third_puls_yes trials_this_epoch_where_third_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_second_puls_no_then_third_puls_yes)/length(trials_this_epoch_where_second_pulse_failed);x_val=0;
        else
            trls_rt_interval_then_second_puls_no_then_third_puls_yes=[];
            for i=1:length(trials_this_epoch_where_third_pulse_succeeded)
                for j=1:length(trials_with_correct_interval_and_failed_second_pulse)
                    if trials_this_epoch_where_third_pulse_succeeded(i)==trials_with_correct_interval_and_failed_second_pulse(j)
                        trls_rt_interval_then_second_puls_no_then_third_puls_yes=[trls_rt_interval_then_second_puls_no_then_third_puls_yes trials_this_epoch_where_third_pulse_succeeded(i)];end,end,end
            valid_values=length(trls_rt_interval_then_second_puls_no_then_third_puls_yes)/length(trials_with_correct_interval_and_failed_second_pulse);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trials_this_epoch_where_second_pulse_failed),f_s,f_w)
        
        %sixth column:  o+ a+
        handlez(24)=subplot(3,9,24);title('o+ a+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_yes_and_second_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_second_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_where_second_pulse_succeeded(j)
                        trls_first_puls_yes_and_second_puls_yes=[trls_first_puls_yes_and_second_puls_yes trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_yes_third_yes)/length(trls_first_puls_yes_and_second_puls_yes);x_val=0;
        else
            first_yes_rt_interval_second_yes=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_yes_and_second_puls_yes)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_yes_and_second_puls_yes(j)
                        first_yes_rt_interval_second_yes=[first_yes_rt_interval_second_yes trials_this_epoch_having_this_interval(i)];end,end,end      
            valid_values=length(first_yes_rt_int_second_yes_third_yes)/length(first_yes_rt_interval_second_yes);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_yes_and_second_puls_yes),f_s,f_w)
        
        %seventh column:  o+ a-
        handlez(25)=subplot(3,9,25);title('o+ a-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_yes_then_second_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_succeeded)
                for j=1:length(trials_this_epoch_where_second_pulse_failed)
                    if trials_this_epoch_where_first_pulse_succeeded(i)==trials_this_epoch_where_second_pulse_failed(j)
                        trls_first_puls_yes_then_second_puls_no=[trls_first_puls_yes_then_second_puls_no trials_this_epoch_where_first_pulse_succeeded(i)];end,end,end
            valid_values=length(first_yes_second_no_third_yes)/length(trls_first_puls_yes_then_second_puls_no);x_val=0;
        else
            first_yes_rt_interval_second_no=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_yes_then_second_puls_no)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_yes_then_second_puls_no(j)
                        first_yes_rt_interval_second_no=[first_yes_rt_interval_second_no trials_this_epoch_having_this_interval(i)];end,end,end
            valid_values=length(first_yes_rt_int_second_no_third_yes)/length(first_yes_rt_interval_second_no);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_yes_then_second_puls_no),f_s,f_w)
        
        %eighth column:  o- a+
        handlez(26)=subplot(3,9,26);title('o- a+','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_no_and_second_puls_yes=[];
            for i=1:length(trials_this_epoch_where_first_pulse_failed)
                for j=1:length(trials_this_epoch_where_second_pulse_succeeded)
                    if trials_this_epoch_where_first_pulse_failed(i)==trials_this_epoch_where_second_pulse_succeeded(j)
                        trls_first_puls_no_and_second_puls_yes=[trls_first_puls_no_and_second_puls_yes trials_this_epoch_where_first_pulse_failed(i)];end,end,end
            valid_values=length(first_no_second_yes_third_yes)/length(trls_first_puls_no_and_second_puls_yes);x_val=0;
        else
           first_no_rt_interval_second_yes=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_no_and_second_puls_yes)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_no_and_second_puls_yes(j)
                        first_no_rt_interval_second_yes=[first_no_rt_interval_second_yes trials_this_epoch_having_this_interval(i)];end,end,end
            valid_values=length(first_no_rt_int_second_yes_third_yes)/length(first_no_rt_interval_second_yes);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_no_and_second_puls_yes),f_s,f_w)
        
        %ninth column:  o- a-
        handlez(27)=subplot(3,9,27);title('o- a-','fontsize',f_s,'fontweight',f_w)
        if interval>length(hy)
            trls_first_puls_no_and_second_puls_no=[];
            for i=1:length(trials_this_epoch_where_first_pulse_failed)
                for j=1:length(trials_this_epoch_where_second_pulse_failed)
                    if trials_this_epoch_where_first_pulse_failed(i)==trials_this_epoch_where_second_pulse_failed(j)
                        trls_first_puls_no_and_second_puls_no=[trls_first_puls_no_and_second_puls_no trials_this_epoch_where_first_pulse_failed(i)];end,end,end
            first_no_second_no_third_yes=[];
            for i=1:length(trials_this_epoch_where_third_pulse_succeeded)
                for j=1:length(trls_first_puls_no_and_second_puls_no)
                    if trials_this_epoch_where_third_pulse_succeeded(i)==trls_first_puls_no_and_second_puls_no(j)
                        first_no_second_no_third_yes=[first_no_second_no_third_yes trials_this_epoch_where_third_pulse_succeeded(i)];end,end,end
            valid_values=length(first_no_second_no_third_yes)/length(trls_first_puls_no_and_second_puls_no);x_val=0;
        else
           first_no_rt_interval_second_no=[];
            for i=1:length(trials_this_epoch_having_this_interval)
                for j=1:length(trls_first_puls_no_and_second_puls_no)
                    if trials_this_epoch_having_this_interval(i)==trls_first_puls_no_and_second_puls_no(j)
                        first_no_rt_interval_second_no=[first_no_rt_interval_second_no trials_this_epoch_having_this_interval(i)];end,end,end
            first_no_rt_int_second_no_third_yes=[];
            for i=1:length(first_no_second_no_third_yes)
                for j=1:length(trials_this_epoch_having_this_interval)
                    if first_no_second_no_third_yes(i)==trials_this_epoch_having_this_interval(j)
                        first_no_rt_int_second_no_third_yes=[first_no_rt_int_second_no_third_yes first_no_second_no_third_yes(i)];end,end,end      
            valid_values=length(first_no_rt_int_second_no_third_yes)/length(first_no_rt_interval_second_no);x_val=log2(hy(interval));
        end
        stsd_grid_plotter_irreg_spaced_innerportion(x_val,valid_values,parameter_colors,parameter,epoch,epoch_shift,interval,text_interval,length(trls_first_puls_no_and_second_puls_no),f_s,f_w)
        
        if epoch==length(epoch_dividers)+1 & interval==1  %this is all about getting the axes aligned -- you know, for comparison?
            set(handlez(1:27),'xlim',[-1 10]);
            set(handlez(1:27),'ylim',[min(min(cell2mat(get(handlez(1:27),'ylim')))) max(max(cell2mat(get(handlez(1:27),'ylim'))))]);
            a=[1:27];a([1 10 19])=[];
            set(handlez(a),'ytick',[])
            set(handlez,'xtick',[])
                        
            %subplot(3,3,1),text(min(min(cell2mat(get(handlez(1:27),'xlim')))),max(max(cell2mat(get(handlez(1:27),'ylim')))),'P release','fontsize',20,'fontweight','bold')               
        end    
    end
    if length(epoch_dividers)>epoch,trials_this_epoch=[epoch_dividers(epoch)+.5 :epoch_dividers(epoch+1)-.5];
    elseif length(epoch_dividers)==epoch,trials_this_epoch=[epoch_dividers(epoch)+.5:size(plain_extractedmatrix,2)];
    end
end