%load('G:\My Drive\Paper_ACh_OXT\Fig2\Data\Figure2B\ACh_OXT_behaviorTrans.mat','dF_NRtranAll','dF_RWtranAll','dF_NWtranAll')

%% figures NREM-REM
figure;
outsr = 100;
imagesc([1:size(dF_NRtranAll.ACh,2)./outsr]'-20,[1:size(dF_NRtranAll.ACh,1)]',...
    zscore(dF_NRtranAll.ACh,[],2));
zlim = [-8 3];
caxis(zlim)
colormap(NegativeEnhancingColormap(256, zlim, ...
        [0 0 1], [1 0 0],[1 1 1],1.25));
ylabel('Cell Number');colorbar
xlabel('Times from transit (s)'); ylabel('REM rumber #'); title('NREM-REM-ACh')

figure;
outsr = 100;
imagesc([1:size(dF_NRtranAll.Oxt,2)./outsr]'-20,[1:size(dF_NRtranAll.Oxt,1)]',...
    zscore(dF_NRtranAll.Oxt,[],2));
zlim = [-8 3];
caxis(zlim)
colormap(NegativeEnhancingColormap(256, zlim, ...
        [0 0 1], [1 0 0],[1 1 1],1.25));
ylabel('Cell Number');colorbar
xlabel('Times from transit (s)'); ylabel('REM rumber #'); title('NREM-REM-OXT')

%% figure REM-wake
figure;
outsr = 100;
imagesc([1:size(dF_RWtranAll.ACh,2)./outsr]'-20,[1:size(dF_RWtranAll.ACh,1)]',...
    zscore(dF_RWtranAll.ACh,[],2));
zlim = [-8 3];
caxis(zlim)
colormap(NegativeEnhancingColormap(256, zlim, ...
        [0 0 1], [1 0 0],[1 1 1],1.25));
ylabel('Cell Number');colorbar
xlabel('Times from transit (s)'); ylabel('REM rumber #');title('REM-WAKE-ACh')

figure;
outsr = 100;
imagesc([1:size(dF_RWtranAll.Oxt,2)./outsr]'-20,[1:size(dF_RWtranAll.Oxt,1)]',...
    zscore(dF_RWtranAll.Oxt,[],2));
zlim = [-8 3];
caxis(zlim)
colormap(NegativeEnhancingColormap(256, zlim, ...
        [0 0 1], [1 0 0],[1 1 1],1.25));
ylabel('Cell Number');colorbar
xlabel('Times from transit (s)'); ylabel('REM rumber #');title('REM-WAKE-Oxt')

%% NREM-wake
figure;
outsr = 100;
imagesc([1:size(dF_NWtranAll.ACh,2)./outsr]'-50,[1:size(dF_NWtranAll.ACh,1)]',...
    zscore(dF_NWtranAll.ACh,[],2));
zlim = [-8 3];
caxis(zlim)
colormap(NegativeEnhancingColormap(256, zlim, ...
        [0 0 1], [1 0 0],[1 1 1],1.25));
ylabel('Cell Number');colorbar
xlabel('Times from transit (s)'); ylabel('REM rumber #');title('NREM-WAKE')

figure;
outsr = 100;
imagesc([1:size(dF_NWtranAll.Oxt,2)./outsr]'-50,[1:size(dF_NWtranAll.Oxt,1)]',...
    zscore(dF_NWtranAll.Oxt,[],2));
zlim = [-8 3];
caxis(zlim)
colormap(NegativeEnhancingColormap(256, zlim, ...
        [0 0 1], [1 0 0],[1 1 1],1.25));
ylabel('Cell Number');colorbar
xlabel('Times from transit (s)'); ylabel('REM rumber #');title('NREM-WAKE')