clear all;

dat = [...
0.1132182320	-1.0000000000	-1.0000000000	-1.0000000000; ... %Xeko3
0.7367873137	-1.0000000000	-1.0000000000	-1.0000000000; ... %Zeno10
0.0681504702	-1.0000000000	-1.0000000000	-1.0000000000; ... %Anchovy3
0.4357138587	-1.0000000000	-1.0000000000	-1.0000000000; ... %Anchovy4
0.8456093378	-1.0000000000	-1.0000000000	-1.0000000000; ... %Stimpy6
0.6452864266	-1.0000000000	-1.0000000000	-1.0000000000; ... %Stimpy3
0.5526397289	-0.3775763224	-0.5526272766	-0.3475133244; ... %Trouble22467
0.5567814622	-0.4084580655	-0.3962169904	-0.2955323460; ... %Usain22493
0.2508039829	-0.3055662552	-0.3004512174	-0.3616083278; ... %Wingnut22468
0.2699535395	-0.6010266865	-0.4921667872	-0.9454888728; ... %Xinhai22493
0.5246777930	-0.5289961163	-0.8932852982	-0.4299708723; ... %Atlas22493
0.7388461731	-0.6382941917	-0.6934207964	-0.6675608857];    %Dojo22493
% column1: change in mini amplitude
% column2: change in overall firing rate (3hr pre-drug vs. 24hr post-drug)
% column3: initial change in FR (3hr pre-drug vs. 1st hour post-drug)
% column4: final change in FR (3hr pre-drug vs. 24th hour post-drug)

hold off;
c = [0 0.3 0.7; ...
    0 0.3 0.7; ...
    0 0.3 0.7; ...
    0 0.3 0.7; ...
    0 0.3 0.7; ...
    0 0.3 0.7; ...
    1 0 0; ...
    1 0 0; ...
    1 0 0; ...
    1 0 0; ...
    1 0 0; ...
    1 0 0];

for i = 1:size(dat,1)
    handlevector(:,i) = plot(dat(i,2)*100,dat(i,1)*100,'.','MarkerSize',25,'Color',c(i,:));
    hold on;
%     hold all;
end
legend(handlevector([1 7]),{'TTX','CNQX'}, 'Location','NorthEast');
axis([-105 105 -105 105]);
%plot([-105 105],[0 0],'--k','LineWidth',2);
%plot([0 0],[-105 105],'--k','LineWidth',2);

% plot([-105 5],[mean(dat(1:6,1)),mean(dat(1:6,1))]*100,'--','Color',[0 0.3 0.7]);
% plot([-105 5],[mean(dat(7:12,1)),mean(dat(7:12,1))]*100,'--','Color',[1 0 0]);
% plot([mean(dat(1:6,2)),mean(dat(1:6,2))]*100,[-5 105],'--','Color',[0 0.3 0.7]);
% plot([mean(dat(7:12,2)),mean(dat(7:12,2))]*100,[-5 105],'--','Color',[1 0 0]);
axis square;

set(gca,'FontSize',14,'XTick',-100:20:100,'YTick',-100:20:100,'LineWidth',2);
ylabel('Percent Change in mEPSC Amplitude','FontSize',16);
xlabel('Percent Change in Network Spiking after Drug','FontSize',16);

stats = regstats(dat(:,1),dat(:,2),'linear');
text(-103,101,['R^2=',num2str(stats.rsquare) ' for linear fit'],'FontSize',16);
box off;

% axis([-105 0 0 105]);
% set(gca,'YAxisLocation','right','TickDir','out');

axis([-105 5 -5 105]);
set(gca,'YAxisLocation','right','TickDir','out');
set(gcf,'Position',[1541         215         619         563]);
