123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- %% fig. S6AB - Proportion of correlated cells
- % Load necessary data for fig.S4A
- clear all
- close all
- % =========================================================================
- %% Load data
- % =========================================================================
- %Prepare variables
- %load('figS6A.mat'); %For locomotion
- load('figS6B.mat'); %For pupil
- %SigCorrCell
- %Row 1 = Stimulus
- %Row 2 = Delay
- %Row 3 = ITI
- % =========================================================================
- %% Bar plot of the proportion of correlated cells
- % =========================================================================
- NofCell = 210;
- for iTaskWindow = 1:3
- % 1: Stimulus
- % 2: Delay
- % 3: ITI
- switch iTaskWindow
- case 1
- FigtTitle = 'Stimulus period';
- case 2
- FigtTitle = 'Delay period';
- case 3
- FigtTitle = 'ITI period';
- end
-
- Data4StackBar_SigCorrCell = [];
- for iPhase = 1:4
- Data4StackBar_SigCorrCell(iPhase, :) = ...
- [NofCell-SigCorrCell(iTaskWindow, iPhase) SigCorrCell(iTaskWindow, iPhase)]/NofCell;
- end
-
- fig = figure('Name', FigtTitle);
- fig.Position = [410 278 500 220];
- for iPhase = [1 3]
- switch iPhase
- case 1
- Figtitle_Inside = 'Initial - SigCorrCell';
- PlotPos = 1;
- case 3
- Figtitle_Inside = 'Reversal - SigCorrCell';
- PlotPos = 2;
- end
-
- subplot(1,2, PlotPos)
-
- StackedBar = bar(Data4StackBar_SigCorrCell(iPhase:iPhase+1, :),'stacked', 'FaceColor', 'flat');
- set(StackedBar,'EdgeColor', 'none');
- ylim([0 1.1]);
- StackedBar(1).CData = [0.85 0.85 0.85]; %Non-sig
- StackedBar(2).CData = [1 0.85 0.85]; %Sig corr
- box off
- lgd = legend('Non.Sig','Sig.');
- lgd.Location = 'SouthEast';
- lgd.Box = 'off';
- title(Figtitle_Inside);
- end %iPhase
- end
|