%% fig. S6I - Population response in Hit trial with/out anticipatory lick clear all close all % ========================================================================== %% Load data % ========================================================================== %Prepare variables load('figS6I.mat'); % =========================================== %% Plot population response Hit Lick/Nonlick % =========================================== TimeWinFrame = [-5:1:60]; fs = 30; fig1 = figure('Name','HitPopulation_LickNonLick'); fig1.Position = [1200 200 550 280]; for iLick = 1:2 %1 == Lick, 2 == NonLick for iPhase = 1:2 % 1 = Initial Expert, 2 = Reversal Expert meanResp = []; SEM = []; %iLick switch iLick case 1 meanResp = MeanHitLick(:, :, iPhase); %Population x frame x (Initial or Reversal) SEM = SEMHitLick(:, :, iPhase); %1 x frame x (Initial or Reversal) Color = 'b'; case 2 meanResp = MeanHitNonLick(:, :, iPhase);%Population x frame x (Initial or Reversal) SEM = SEMHitNonLick(:, :, iPhase); %1 x frame x (Initial or Reversal) Color = 'k'; end %Draw LinePlot------------------------------------------------------ subplot(1, 2, iPhase); f1 = shadedErrorBar(TimeWinFrame/fs, meanResp, SEM, 'lineprops', Color); axis square; set([f1.edge], 'Visible', 'off') hold on %Adjust x axis----------------------------------------------------- hline(0, 'k'); xlim([-0.15 2.0]) xticks([0 2]); ylim([-0.15 0.15]); yticks([-0.1 0 0.1]); xlabel('Time from Stimulus (s)') %Add title--------------------------------------------------------- switch iPhase case 1 %Initial Expert title('Initial-Expert') ylabel('zScore', 'FontSize', 10,'FontWeight','bold') if (iLick == 2) legend('Lick', 'NonLick', 'Location', 'northeast'); legend ('boxoff') end case 2 %Reversal Expert title('Reversal-Expert') end%switch-iPhase end %for - iPhase end%for iLick suptitle('Population Response Hit - Lick vs NonLick')