123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- % plot one neuron activity to make explanatory diagram
- load('all_psth.mat');
- bins=0.002;
- load('E:\Users\User\Documents\MATLAB\delays analysis\awake analysis\stim_onsetFSv2.mat');
- stim_onset=stim_onset/192000;
- unit_to_plot=55;
- state=3; % awake
- c1=psths(:,1)==state;
- c2=psths(:,2)==unit_to_plot;
- nav_iso=psths(:,3)==1; % echolocation isolated
- com_iso=psths(:,3)==2; % communication isolated
- nav_unexp=psths(:,3)==3; % unexpected navigation context
- nav_exp=psths(:,3)==4; % expected navigation context
- com_unexp=psths(:,3)==5; % unexpected communication context
- com_exp=psths(:,3)==6; % expected communication context
- % plotting
- figure(1); set(gcf,'Position',[200 200 250 90])
- t=tiledlayout(1,2);
- % no context
- ax1 = nexttile;
- % plot echolocation
- y=psths(logical(c1.*c2.*nav_iso),4:end);
- x=bins*(0:size(y,2)-1);
- w = gausswin(20);
- y = filter(w,1,y);
- plot(x,y,'b','LineWidth',1.5); hold on
- % plot communication
- y=psths(logical(c1.*c2.*com_iso),4:end);
- x=bins*(0:size(y,2)-1);
- y = filter(w,1,y);
- plot(x,y,'r','LineWidth',1.5)
- % plotting format
- xlim([3.5 3.7])
- % ylim([-1 6])
- xline(stim_onset(2),'Color','k','LineWidth',1,'LineStyle',':')
- set(gca, 'box', 'off')
- set(gca, 'Color','none')
- set(gca,'linewidth',1);set(gca,'fontsize',8);
- set(gca,'xtick',[])
- set(gca,'ytick',[])
- % echolocation context
- ax2 = nexttile;
- % plot echolocation
- y=psths(logical(c1.*c2.*nav_exp),4:end);
- x=bins*(0:size(y,2)-1);
- w = gausswin(20);
- y = filter(w,1,y);
- plot(x,y,'b','LineWidth',1.5); hold on
- % plot communication
- y=psths(logical(c1.*c2.*nav_unexp),4:end);
- x=bins*(0:size(y,2)-1);
- y = filter(w,1,y);
- plot(x,y,'r','LineWidth',1.5)
- % plotting format
- xlim([1.54 1.74])
- ylim([-1 6])
- xline(stim_onset(4),'Color','k','LineWidth',1,'LineStyle',':')
- set(gca, 'box', 'off')
- set(gca, 'Color','none')
- set(gca,'linewidth',1);set(gca,'fontsize',8);
- set(gca,'xtick',[])
- set(gca,'ytick',[])
- % exportgraphics(gcf,'E:\Users\User\Desktop\delay paper\anesthesia_afterreviews\unit_response.pdf',...
- % 'Resolution',300','ContentType','vector','BackgroundColor','none')
|