% This file is licensed under the Allen Institute Terms of Use, which can be found at:
%http://www.alleninstitute.org/Media/policies/terms_of_use_content.html

%------------------------------------------------------------------------------------

%%%%Script to generate plots for Figure 4 (excitabilities for a given
%%%%set of matched distributions with input rate of 1000 Hz).

clear variables;

%Plot settings
fnt = 20;
fntlab = 18;
xtc = [1;50;100];  %x-axis ticks for time in (ms)
ytc = [0;5;10;15;20]*10^-3; %y-axis ticks for membrane potential in (mV)
xtl = [0;5;10]; %x-axis labels for time in (ms)
ytl = [0;5;10;15;20]; %y-axis labels for membrane potential in (mV)

set(0,'DefaultFigureWindowStyle','docked');
set(0,'defaultAxesFontName', 'Arial');

load 'excitabilities_1000.mat';

%%%EXCITABILITY WITHOUT DEPRESSION PLOT
figure;
s5 = subplot(1,2,1);
hold all;
plot(1:length(excit_no_sd(:,5)),excit_no_sd(:,5),'linewidth',2);
plot(1:length(excit_no_sd(:,1)),excit_no_sd(:,1),'linewidth',2);
plot(1:length(excit_no_sd(:,3)),excit_no_sd(:,3),'linewidth',2);
plot(1:length(excit_no_sd(:,4)),excit_no_sd(:,4),'linewidth',2);
plot(1:length(excit_no_sd(:,6)),excit_no_sd(:,6),'Color',[0.2,0,0.5],'linewidth',2);
plot(1:length(excit_no_sd(:,2)),excit_no_sd(:,2),'Color',[0.8,0.8,0],'linewidth',2);
plot(10,excit_no_sd(10,5),'s','MarkerFaceColor','k','Markersize',10)
hold off;
axis([1 length(excit_no_sd(:,1)) 0 3]);
set(gca,'FontSize',fnt);
set(gca,'XTick',xtc);
set(gca,'XTickLabel',xtl);
set(gca,'FontSize',fnt);
ylabel('Relative excitability (\epsilon)');xlabel('Mean add. inputs per neuron (\lambda) \newline                       (a)');
axis square ;box on;
leg1 = legend('Delta','Gauss','Exp','LogN','Bimodal','PL');
set(leg1,'FontSize',fntlab,'Interpreter','tex','Location','SouthEast');

%%%EXCITABILITY WITH DEPRESSION PLOT
s6 = subplot(1,2,2);
hold all;
plot(1:length(excit_sd(:,5)),excit_sd(:,5),'linewidth',2);
plot(1:length(excit_sd(:,1)),excit_sd(:,1),'linewidth',2);
plot(1:length(excit_sd(:,3)),excit_sd(:,3),'linewidth',2);
plot(1:length(excit_sd(:,4)),excit_sd(:,4),'linewidth',2);
plot(1:length(excit_sd(:,6)),excit_sd(:,6),'Color',[0.2,0,0.5],'linewidth',2);
plot(1:length(excit_sd(:,2)),excit_sd(:,2),'Color',[0.8,0.8,0],'linewidth',2);
hold off;
axis([1 length(excit_sd(:,1)) 0 3]);
set(gca,'FontSize',fnt);
set(gca,'XTick',xtc);
set(gca,'XTickLabel',xtl);
set(gca,'FontSize',fnt);
ylabel('Relative excitability (\epsilon)');xlabel('Mean add. inputs per neuron (\lambda) \newline                       (b)');
axis square;box on;
leg2 = legend('Delta','Gauss','Exp','LogN','Bimodal','PL');
set(leg2,'FontSize',fntlab,'Interpreter','tex','Location','NorthEast');

print2eps Fig4.eps


