function Fig4Science_data_example_cell


close all
Fig4 = figure('Name','Fig4 Science Rebuttal 033d110511s3', 'PaperUnits', 'centimeters');
Width = 12;
Height = 17;
PixelsPerCm = 85/2.54;
set(gcf, 'PaperSize', [Width Height])
set(gcf, 'PaperPosition', [.5 1 Width Height])
set(gcf, 'Position', get(gcf, 'PaperPosition') * PixelsPerCm);
set(gcf,'DefaultAxesFontSize',10, 'DefaultTextFontName', 'Helvetica','DefaultAxesFontName', 'Helvetica')

PanelLetters = cell(4,1);
PanelLetters{1,1} = 'b';
Dimension = size(PanelLetters);
RightMargin = .2;
LeftMargin = .07;
TopMargin = .07;
BottomMargin = .05;
InterPanelWidth = eps;
InterPanelHeight = .05;
LetterFontSize = 12;
LetterX = -.05;
LetterY = -.035;
PanelHandles = MultiPanel(Fig4,Dimension, [LeftMargin, RightMargin, BottomMargin, TopMargin], [InterPanelWidth, InterPanelHeight], [LetterX, LetterY], PanelLetters, LetterFontSize);
%
PanelLetters = cell(4,1);
PanelLetters{1,1} = 'c';
Dimension = size(PanelLetters);
RightMargin = .01;
LeftMargin = .9;
PanelHandles(:, end + 1) = MultiPanel(Fig4,Dimension, [LeftMargin, RightMargin, BottomMargin, TopMargin], [InterPanelWidth, InterPanelHeight], [LetterX, LetterY], PanelLetters, LetterFontSize);

load('Fig4Science_data_example_cell_vars.mat');

axes(PanelHandles(1,1))
slen= 0.5;  %length of line representing spike

HitLineWidth=3;

TrialNum=length(Nano25ConIncTimes);
TrialLim=TrialNum+0.5;
for i= 1:length(Nano25ConIncTimes)
   t= Nano25ConIncTimes(i,1);
   rt= Nano25ConIncTimes(i,2);
   s= SpikeTimesNew(SpikeTimesNew>t-1 & SpikeTimesNew<t+2);
   for j= 1:length(s)
       if (s(j)<t | s(j)>t+0.001) & (s(j)<t+0.199 | s(j)>t+0.2)
           l= line([s(j)-t s(j)-t],[i-slen i+slen]);
           set(l,'color','k')
       end
   end
   if rt>0 & rt<2
       l= line([rt rt],[i-slen i+slen]);
       set(l,'color','r')
       set(l,'linewidth',HitLineWidth)
   end
end
axis([-1 2 0 TrialLim])
set(gca,'xticklabel',[])
set(gca,'ytick',[0 TrialNum])
set(gca,'xtick',[-1 0 1])
set(gca,'tickdir','out','FontName','Helvetica')
myxlim=xlim;
myylim=ylim;

axes(PanelHandles(1,2))
p= bar([Nano25IncHits]);
set(p,'facecolor','none')

ylim([0 (Nano25IncHits+Nano25IncMisses)])
xlim([.5 1.5])
set(gca,'xtick',[]);
set(gca,'ytick',[0 Nano25IncHits+Nano25IncMisses],'TickLength',[0.05 0.05])
set(gca,'ytick',[0 Nano25IncHits+Nano25IncMisses])
set(gca,'xticklabel',[])
set(gca,'tickdir','out','FontName','Helvetica')

myxlim=xlim;
myylim=ylim;
text(myxlim(1)+diff(myxlim)*0.3,myylim(2)-diff(myylim)*0.05,[num2str(round(Nano25HitRate*100)), '%'],'FontName','Helvetica');
box off


axes(PanelHandles(2,1))
slen= 0.5;  %length of line representing spike

HitLineWidth=3;

TrialNum=length(Nano100ConIncTimes);
TrialLim=TrialNum+0.5;
for i= 1:length(Nano100ConIncTimes)
   t= Nano100ConIncTimes(i,1);
   rt= Nano100ConIncTimes(i,2);
   s= SpikeTimesNew(SpikeTimesNew>t-1 & SpikeTimesNew<t+2);
   for j= 1:length(s)
       if (s(j)<t | s(j)>t+0.001) & (s(j)<t+0.199 | s(j)>t+0.2)
           l= line([s(j)-t s(j)-t],[i-slen i+slen]);
           set(l,'color','k')
       end
   end
   if rt>0 & rt<2
       l= line([rt rt],[i-slen i+slen]);
       set(l,'color','r')
       set(l,'linewidth',HitLineWidth)
   end
end
axis([-1 2 0 TrialLim])
set(gca,'xticklabel',[])
set(gca,'ytick',[0 TrialNum])
set(gca,'xtick',[-1 0 1])
set(gca,'tickdir','out','FontName','Helvetica')
myxlim=xlim;
myylim=ylim;


axes(PanelHandles(2,2))
p= bar([Nano100IncHits]);
set(p,'facecolor','none')
ylim([0 (Nano100IncHits+Nano100IncMisses)])
xlim([.5 1.5])
set(gca,'xtick',[]);
set(gca,'ytick',[0 Nano100IncHits+Nano100IncMisses],'TickLength',[0.05 0.05])
set(gca,'ytick',[0 Nano100IncHits+Nano100IncMisses])
set(gca,'xticklabel',[])
set(gca,'tickdir','out','FontName','Helvetica')

myxlim=xlim;
myylim=ylim;
text(myxlim(1)+diff(myxlim)*0.3,myylim(2)-diff(myylim)*0.05,[num2str(round(Nano100HitRate*100)), '%'],'FontName','Helvetica');
box off


axes(PanelHandles(3,1))
TrialNum=length(CatchIncTimes);
TrialLim=TrialNum+0.5;
for i= 1:length(CatchIncTimes)
   t= CatchIncTimes(i,1);
   rt= CatchIncTimes(i,2);
   s= SpikeTimesNew(SpikeTimesNew>t-1 & SpikeTimesNew<t+2);
   for j= 1:length(s)
       l= line([s(j)-t s(j)-t],[i-slen i+slen]);
       set(l,'color','k')
   end
   if rt>0 & rt<2
       l= line([rt rt],[i-slen i+slen]);
       set(l,'color','r')
       set(l,'linewidth',HitLineWidth)
   end
end
axis([-1 2 0 TrialLim])
set(gca,'xticklabel',[])
set(gca,'ytick',[0 TrialNum])
set(gca,'xtick',[-1 0 1])
set(gca,'tickdir','out','FontName','Helvetica')
myxlim=xlim;
myylim=ylim;


axes(PanelHandles(3,2))
p= bar([CatchIncHits]);
set(p,'facecolor','none')
ylim([0 CatchIncHits+CatchIncMisses])
xlim([.5 1.5])
set(gca,'xtick',[]);
set(gca,'ytick',[0 CatchIncHits+CatchIncMisses],'TickLength',[0.05 0.05])
set(gca,'xticklabel',[])
set(gca,'tickdir','out','FontName','Helvetica')

myxlim=xlim;
myylim=ylim;
text(myxlim(1)+diff(myxlim)*0.3,myylim(2)-diff(myylim)*0.05,[num2str(round(CatchHitRate*100)), '%'],'FontName','Helvetica');
box off

axes(PanelHandles(4,1))
TrialNum=length(Nano25ConIncTimes);
TrialLim=TrialNum+0.5;

for i2= 1:length(microstim_sub_trials)
   i= microstim_sub_trials(i2);
   t= MicroIncTimes(i,1);
   rt= MicroIncTimes(i,2);
   s= SpikeTimesNew(SpikeTimesNew>t-1 & SpikeTimesNew<t+2);
   for j= 1:length(s)
       if s(j)<t | s(j)>t+0.2
           l= line([s(j)-t s(j)-t],[i2-slen i2+slen]);
           set(l,'color','k')
       end 
   end
   if rt>0 & rt<2
       l= line([rt rt],[i2-slen i2+slen]);
       set(l,'color','r')
       set(l,'linewidth',HitLineWidth)
   end
end
axis([-1 2 0 TrialLim])
set(gca,'ytick',[0 TrialNum])
set(gca,'xtick',[-1 0 0.1 1 1.2])
set(gca,'xticklabel',{-1;0;'';1;''})
set(gca,'tickdir','out','FontName','Helvetica')
myxlim=xlim;
myylim=ylim;


axes(PanelHandles(4,2))
p= bar([MicroIncHits]);
set(p,'facecolor','none')
ylim([0 MicroIncHits+MicroIncMisses])
xlim([.5 1.5])
set(gca,'xtick',[]);
set(gca,'ytick',[0 MicroIncHits+MicroIncMisses],'TickLength',[0.05 0.05])
set(gca,'xticklabel',[])
set(gca,'tickdir','out','FontName','Helvetica')

myxlim=xlim;
myylim=ylim;
text(myxlim(1)+diff(myxlim)*0.3,myylim(2)-diff(myylim)*0.05,[num2str(round(MicroHitRate*100)), '%'],'FontName','Helvetica');
box off

end
% 
% 
