function stsd_grid_plotter(nlize_raw_reporter,raw_axis,trials_to_current_trial,permutations_of_IPIs,possible_repetitions_of_permutation,APs_in_the_train,max_length_raw,number_of_trials,... stsd_raw_matrix,prosslog_name,autaptic_reporter,hy) %laying out the raw segments %as of feb25 2004, this can handle one, two or three IPIs -- needs a bit more tinkering to handle up to six IPIs (train of 7 APs) figure(23) hold on EPSCo_overlay=[]; crash_test=[]; if strcmp(nlize_raw_reporter,'__normalized'),grid_axis=[0 max_length_raw 0 1.5];else grid_axis=[0 max_length_raw raw_axis(3) raw_axis(4)]; end c=colormap(hsv(length(trials_to_current_trial))); general_PSC_vector=prod(permutations_of_IPIs)*possible_repetitions_of_permutation*APs_in_the_train*[0:max_length_raw-1]; AP_indexing_increment=prod(permutations_of_IPIs)*possible_repetitions_of_permutation; width_=1/(length(permutations_of_IPIs)+1); for superman=1:number_of_trials %if superman == 1, lanky=10,elseif superman==2,lanky=4,elseif superman == 3, lanky = 13, elseif superman== 4, lanky =15,end if stsd_raw_matrix(superman+general_PSC_vector)<0 | stsd_raw_matrix(superman+general_PSC_vector)>0 | stsd_raw_matrix(superman+general_PSC_vector)==0 %if this vector has been used (is not NaN) EPSCo_overlay(superman,:)=stsd_raw_matrix(superman+general_PSC_vector); subplot('position',[0 1/4 width_ 1/2]) plot(EPSCo_overlay(superman,:),'Color',c(superman,:)) if superman==1,title(strcat(prosslog_name,autaptic_reporter,nlize_raw_reporter)),text((max_length_raw/3),(.5*abs(grid_axis(4)-grid_axis(3))),num2str(hy)),end hold on,axis(grid_axis)%,axis off for genesis=1:permutations_of_IPIs(1) for zod=1:number_of_trials/permutations_of_IPIs(1) inddex=genesis+((zod-1)*hy(1,1)); if stsd_raw_matrix(inddex+general_PSC_vector)==stsd_raw_matrix(superman+general_PSC_vector) %if the given trial (superman) has IPIa == genesis floor_of_plot=1-(genesis/permutations_of_IPIs(1)); subplot('position',[width_ floor_of_plot width_ 1/permutations_of_IPIs(1)]) crash_test(zod,:)=stsd_raw_matrix(inddex+general_PSC_vector+AP_indexing_increment); plot(crash_test(zod,:),'Color',c(superman,:)),hold on,axis(grid_axis)%,axis off if length(permutations_of_IPIs)>1 col=rem(zod,hy(1,1)); %given the match in the line above, we now know the column (IPIb) and the sheet (IPIc) as well %need to do IPId,e,f if col==0,col=hy(1,2);end for exodus=1:permutations_of_IPIs(2) if col==exodus floor_of_plot=floor_of_plot+((permutations_of_IPIs(2)-exodus)/prod(permutations_of_IPIs(1:2))); subplot('position',[2*width_ floor_of_plot width_ 1/prod(permutations_of_IPIs(1:2))]) plot(stsd_raw_matrix(inddex+general_PSC_vector+2*AP_indexing_increment),'Color',c(superman,:)),hold on,axis(grid_axis)%,axis off if length(permutations_of_IPIs)>2 sheet=ceil(inddex/(hy(1,1)*hy(1,2))); sheet=rem(sheet,hy(1,3)); if sheet==0,sheet=hy(1,3);end for leviticus=1:permutations_of_IPIs(3) if sheet==leviticus floor_of_plot=floor_of_plot+((3-leviticus)/prod(permutations_of_IPIs(1:3)));%(1-(leviticus/)); subplot('position',[3*width_ floor_of_plot width_ 1/prod(permutations_of_IPIs(1:3))]) plot(stsd_raw_matrix(inddex+general_PSC_vector+3*AP_indexing_increment),'Color',c(superman,:)),hold on,axis(grid_axis)%,axis off if length(permutations_of_IPIs)>3 for numbers=1:permutations_of_IPIs(4) if xxxx==numbers %this still needs to be created %floor_of_plot=floor_of_plot; subplot('position',[4*width_ floor_of_plot width_ 1/prod(permutations_of_IPIs(1:4))]) plot,hold on,axis(grid_axis) if length(permutations_of_IPIs)>4 for deuteronomy=1:permutations_of_IPIs(5) if xxxx==deuteronomy %floor_of_plot=floor_of_plot+ subplot('position',[5*width_ floor_of_plot width_ 1/prod(permutations_of_IPIs(1:5))]) plot,hold on,axis(grid_axis) if length(permutations_of_IPIs)>5 for joshua=1:permutations_of_IPIs(6) if xxxx==joshua %floor_of_plot=floor_of_plot+ subplot('position',[5*width_ floor_of_plot 1/prod(permutations_of_IPIs(1:6))]) plot,hold on,axis(grid_axis) break,break,break,break,break,break,break end end end break,break,break,break,break,break end end end break,break,break,break,break end end end break,break,break,break end end else break,break,break end end end else break,break end end end end end end set(23,'PaperOrientation','landscape'); set(23,'PaperPosition',[0.5 0.5 10 7.5]);