|
@@ -102,8 +102,8 @@ FR = SPIKES_All(nExampleNeuron).spikes;
|
|
|
|
|
|
%% Firing rate for a single neuron
|
|
|
c = [];
|
|
|
-fs = -2; % min(FR(:,3));
|
|
|
-ls = 24; % max(FR(:,3));
|
|
|
+fs = -2;
|
|
|
+ls = 24;
|
|
|
binSize = 0.1;
|
|
|
ranTrials = {};
|
|
|
for i = 1:max(FR(:,2))
|
|
@@ -130,57 +130,57 @@ custom_statfun = @(y)([mean(y);
|
|
|
mean(y) - std(y)/sqrt(17);
|
|
|
mean(y) + std(y)/sqrt(17)]);
|
|
|
g(1).stat_summary('setylim',true,'type',custom_statfun);
|
|
|
-g(1).set_names( 'x','','y','Rate [Hz]' );
|
|
|
-g(1).set_layout_options('position',[0.05 0.7 0.9 0.3])
|
|
|
-g(1).no_legend()
|
|
|
+g(1).set_names( 'x','','y','Rate [Hz]');
|
|
|
+g(1).set_layout_options('position',[0.05,0.7,0.9,0.3]);
|
|
|
+g(1).no_legend();
|
|
|
g(1).axe_property('xlim',[fs 20],'XColor','none');
|
|
|
% Inset
|
|
|
-g(6) = gramm('x',([1:64]-20)/32,'y',waveform(nExampleNeuron,:));
|
|
|
+g(6) = gramm('x',((1:64)-20)/32,'y',waveform(nExampleNeuron,:));
|
|
|
g(6).geom_line();
|
|
|
-g(6).set_names( 'x','Time (ms)','y','uV' );
|
|
|
-g(6).set_layout_options('position',[0.1 0.9 0.1 0.1])
|
|
|
-g(6).set_text_options('base_size',4)
|
|
|
+g(6).set_names('x','Time (ms)','y','uV' );
|
|
|
+g(6).set_layout_options('position',[0.1,0.9,0.1,0.1]);
|
|
|
+g(6).set_text_options('base_size',4);
|
|
|
g(6).set_color_options('chroma',0,'lightness',30);
|
|
|
g(6).set_line_options('base_size',1);
|
|
|
-g(6).no_legend()
|
|
|
+g(6).no_legend();
|
|
|
% g(6).axe_property('xlim',[fs 20],'XColor','none');
|
|
|
% raster
|
|
|
g(2) = gramm('x',ranTrials,'color',c);
|
|
|
-g(2).geom_raster( 'geom','point');
|
|
|
+g(2).geom_raster('geom','point');
|
|
|
g(2).set_point_options('base_size',3);
|
|
|
-g(2).set_names( 'x','Time [s]','y','Trial no. (reordered)' );
|
|
|
-g(2).set_layout_options('position',[0.05 0.43 0.9 0.3])
|
|
|
-g(2).no_legend()
|
|
|
-g(2).axe_property('xlim',[fs 20],'ylim',[-1 9]);
|
|
|
+g(2).set_names('x','Time [s]','y','Trial no. (reordered)');
|
|
|
+g(2).set_layout_options('position',[0.05,0.43,0.9,0.3]);
|
|
|
+g(2).no_legend();
|
|
|
+g(2).axe_property('xlim',[fs,20],'ylim',[-1,9]);
|
|
|
% ISI
|
|
|
g(3) = gramm('x',isis);
|
|
|
g(3).stat_bin();
|
|
|
-g(3).set_layout_options('position',[0.05 0.1 0.25 0.3])
|
|
|
-g(3).set_names( 'x','Percentage of ISI < 3 ms','y','No. of units' );
|
|
|
-g(3).set_color_options('hue_range',[155 200]);
|
|
|
+g(3).set_layout_options('position',[0.05,0.1,0.25,0.3]);
|
|
|
+g(3).set_names('x','Percentage of ISI < 3 ms','y','No. of units');
|
|
|
+g(3).set_color_options('hue_range',[155,200]);
|
|
|
% FR all
|
|
|
g(4) = gramm('x',FiringRatesHz);
|
|
|
g(4).stat_bin();
|
|
|
-g(4).set_layout_options('position',[0.38 0.1 0.25 0.3])
|
|
|
-g(4).set_names( 'x','Firing rate [Hz]','y','No. of units' );
|
|
|
+g(4).set_layout_options('position',[0.38,0.1,0.25,0.3]);
|
|
|
+g(4).set_names('x','Firing rate [Hz]','y','No. of units');
|
|
|
g(4).axe_property('xlim',[0 20]);
|
|
|
g(4).set_color_options('hue_range',[155 200]);
|
|
|
% SNR
|
|
|
g(5) = gramm('x',snr);
|
|
|
g(5).stat_bin();
|
|
|
-g(5).set_layout_options('position',[0.71 0.1 0.25 0.3])
|
|
|
-g(5).set_names( 'x','Waveform peak SNR','y','No. of neurons' );
|
|
|
+g(5).set_layout_options('position',[0.71,0.1,0.25,0.3]);
|
|
|
+g(5).set_names('x','Waveform peak SNR','y','No. of neurons');
|
|
|
g(5).axe_property('xlim',[0 10]);
|
|
|
g(5).set_color_options('hue_range',[155 200]);
|
|
|
% Labels
|
|
|
-x = [0 0 0 0.35 0.68];
|
|
|
-y = [0.97 0.7 0.37 0.37 0.37];
|
|
|
-l = ['a' 'b' 'c' 'd' 'e'];
|
|
|
+x = [0,0,0,0.35,0.68];
|
|
|
+y = [0.97,0.7,0.37,0.37,0.37];
|
|
|
+l = ['a','b','c','d','e'];
|
|
|
g(7) = gramm('x',x,'y',y,'label',l);
|
|
|
-g(7).geom_label('Color','k','fontweight','bold')
|
|
|
-g(7).axe_property('XColor','none','YColor','none','xlim',[0 1],...
|
|
|
- 'ylim',[0 1],'Visible','off');
|
|
|
-g(7).set_layout_options('position',[0 0 1 1])
|
|
|
+g(7).geom_label('Color','k','fontweight','bold');
|
|
|
+g(7).axe_property('XColor','none','YColor','none','xlim',[0,1],...
|
|
|
+ 'ylim',[0,1],'Visible','off');
|
|
|
+g(7).set_layout_options('position',[0,0,1,1]);
|
|
|
g.draw();
|
|
|
|
|
|
% Save figure
|