plotONOFFTracesFromCell.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. function plotONOFFTracesFromCell(allNeuronsOnOffTraces, cellTypeStr, figDir, colors)
  2. cLims = ZeroCenteredBounds(cat(1, allNeuronsOnOffTraces{:}), [0 100]);
  3. hFig = createPrintFig(13 * [1 1]);
  4. hSubAx = plotLasagnaTracesFromCell(hFig, allNeuronsOnOffTraces, colors);
  5. nNeurons = numel(allNeuronsOnOffTraces);
  6. ylabel(hSubAx(1, 1), '\DeltaF / F_0');
  7. title(hSubAx(1, 1), 'ON-OFF full field flashes')
  8. ylabel(hSubAx(1, 2), 'ROI#');
  9. xlabel(hSubAx(1, 2), 'Time (s)');
  10. linkaxes([hSubAx(:, 1)], 'y')
  11. linkaxes([hSubAx(:, 2)], 'y')
  12. hAxDummy = subplot(3, nNeurons + 1, 2*(nNeurons + 1));
  13. hAxDummy.Position(3: 4) = hAxDummy.Position(3: 4) / 2;
  14. imagesc(rand(10)*0, cLims)
  15. hAxDummy.Visible = 'off';
  16. setFavoriteColormap
  17. hCBar = colorbar;
  18. hCBar.Limits = cLims;
  19. hCBar.Label.String = '\Delta F / F_0';
  20. linkaxes(hSubAx, 'x')
  21. arrayfun(@prettifyAxes, [hSubAx(:); hCBar]);
  22. arrayfun(@offsetAxes, [hSubAx(:); hCBar]);
  23. hSubAx(1).XLim =[0 12];
  24. setFontForThesis(hSubAx, hFig)
  25. figFileName = ['OnOff-Traces-' cellTypeStr{:}];
  26. set(gcf,'renderer','painters')
  27. % set(gcf, 'PaperPositionMode', 'auto');
  28. print(hFig, [figDir figFileName '.pdf'], '-dpdf')
  29. print(hFig, [figDir figFileName '.png'], '-dpng', '-r300')
  30. end