12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- %% Code for Fig. 1G, d-prime around learning threshold
- clear
- close all
- % ====================================================================================================
- %% Plot d-prime, Mean +/- SEM (-3 session with d'<1.5 to 3 sessions with d'> 1.5 )
- % ====================================================================================================
- overlay = figure('Name', 'd-prime_AroundCriterion');
- overlay.Position = [100 100 270 350];
- NofMouse = 8;
- %Plot dprime Initial-------------------------------------------------------
- dprime_Initial = ...
- [-0.401 -0.588 1.290 3.162 3.895 3.805
- 1.224 1.633 1.848 2.599 2.363 2.311
- 0.445 0.215 0.516 1.664 2.654 1.975
- -0.588 0.931 1.193 2.682 2.440 2.388
- NaN -0.018 1.396 1.696 2.826 3.590
- 0.398 0.625 0.728 1.664 1.853 2.414
- -0.309 -0.588 1.097 2.286 2.392 3.095
- 0.519 0.215 1.396 2.626 3.423 3.590];
- x = 1:size(dprime_Initial,2);
- TaskTypeColor = [0 0.45 0.74];
- meanResp = [];
- SEM = [];
- meanResp = nanmean(dprime_Initial(:,:),1);
- SEM = nanstd(dprime_Initial(:,:),0,1)/sqrt(NofMouse);
- %N of data point is adjusted by NaN
- SEM(1) = nanstd(dprime_Initial(:,1),0,1)/sqrt(NofMouse-1);
- h1 = errorbar(x, meanResp, SEM, '-o', 'color', TaskTypeColor, 'MarkerFaceColor', TaskTypeColor);
- h1.LineWidth = 1.0;
- hold on;
- box off
- ax = gca;
- ax.FontSize = 12;
- %Plot dprime Reversal------------------------------------------------------
- dprime_Reversal = ...
- [NaN -0.767 -0.338 1.548 2.599 2.183
- 0.388 -0.736 0.866 2.260 3.162 3.374
- 0.371 0.758 1.103 2.492 2.767 NaN
- 1.782 2.293 1.079 1.975 2.388 3.374
- 0.388 -0.338 1.046 2.517 3.201 2.882
- -0.059 0.119 1.117 1.948 1.972 2.608
- 0.818 1.385 0.974 2.260 2.599 2.626
- -0.340 1.320 1.046 2.337 2.327 2.671];
- x = 1:size(dprime_Reversal,2);
- TaskTypeColor = [0.85 0.33 0.10];
- meanResp_Rev = [];
- SEM_Rev = [];
- meanResp_Rev = nanmean(dprime_Reversal(:,:),1);
- SEM_Rev = nanstd(dprime_Reversal(:,:),0,1)/sqrt(NofMouse);
- SEM_Rev(1) = nanstd(dprime_Reversal(:,1),0,1)/sqrt(NofMouse-1);
- SEM_Rev(6) = nanstd(dprime_Reversal(:,6),0,1)/sqrt(NofMouse-1);
- h2 = errorbar (x, meanResp_Rev, SEM_Rev, '-o', 'color', TaskTypeColor, 'MarkerFaceColor', TaskTypeColor);
- h2.LineWidth = 1;
- hold on;
- box off
- %Plot line along d'=1.5. This is learning threshold
- hline(1.5);
- %lim, ticks, labels
- xlim([0.5 6.5]);
- ylim ([-0.5 3.5]);
- NofXticks = 1:1:6;
- xticks(NofXticks);
- xticklabels({'-3', '-2', '-1', '1', '2', '3'})
- yticks([-1.0 0 1.0 2.0 3.0 4.0]);
- xlabel('Session')
- ylabel('d-prime')
- ax = gca;
- ax.FontSize = 12;
- %legend
- led = legend('Initial', 'Reversal', 'Location', 'Southeast');
- legend box off
- %title
- title('d-prime transition','FontSize', 15)
|