% 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 for generating plot for Supplement Fig.S2 showing time-step-independence of DiPDE

clear variables;

%Settings for plot
fnt = 35;
fntleg = 25;

xtc = [0;50;100;150;200]*10^-3;  %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;50;100;150;200]; %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 SuppFigS2.mat

figure;

%FIRING RATE Plots
%-----------------
plot(t_orig_dt0p1,frate_orig_dt0p1,'--',t_orig_dt0p5,frate_orig_dt0p5,'--',t_orig_dt1,frate_orig_dt1,'--','LineWidth',4);
axis([0 0.2 0 6]);
set(gca,'FontSize',fnt);
ylabel('Firing rate (Hz)');xlabel('time (ms)');
set(gca,'XTick',xtc); %set(gca,'YTick',ytc);
set(gca,'XTickLabel',xtl); %set(gca,'YTickLabel',ytl);
axis square; box on;
leg5 = legend('dt=0.1 ms','dt=0.5 ms','dt=1.0 ms');
set(leg5,'FontSize',fntleg,'Interpreter','tex','Location','SouthEast');

print2eps Fig_S2.eps
