%% Make heatmaps for tone responses
type = 'events'; % Manipulations, events
field = 'tone_opto';
%regions = {'ENTm','DG','CA3','CA1'};
regions = {'DG'};
colors = [0 1 0; 1 0 0; 0 0 1; 0 0 0];
minRate = 0;
minPrctile = 10;
printfig = true;

% Create in- and exclude structure
include = struct('brainRegion',regions);
%[include.labels] = deal(opsins);
exclude = struct('putativeCellType',repmat({'unknown'},1,length(regions)));
criteria = struct('firingRate',repmat({[0 Inf]},1,length(regions)));

% DG plot
f1 = figure('position',[200 20 200*length(regions) 350]);
plot_psth(batch_metrics,field,'type',type,'labels',regions,...
    'include',include,'exclude',exclude,...
    'criteria',criteria,'orientation','row',...
    'colors',colors,'minRate',minRate,'minPrctile',minPrctile,...
    'xlimits',[-.1 .401]);

% if printfig
%     pos = get(f1,'Position');
%     set(f1,'PaperPositionMode','Auto','PaperUnits','points',...
%         'PaperSize',[pos(3), pos(4)],'Renderer','Painters')
%     print(f1,sprintf('DS2_response_DG.pdf'),'-dpdf','-r0')
% end