function [] = plotOpticalTraces(compositeTrace, usecells, Hz) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Plots a set of temporal traces (intended to be fluorescence or DF/F) along % with markers to denote when important events (ie. calcium transients) % Inputs: % - compositeTrace: Mx#Neuron temporal traces of the fluorescence % - Usecells: Vector of the temporal traces to plot % - Hz: The imaging rate % Outputs: (none) % - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [tracea, ~] = size(compositeTrace); pace = 1/Hz; time = (1:tracea)*pace; raise = 0; for fn = 1:length(usecells) i = usecells(fn); t = compositeTrace(:, i); dfF = t; dfF = dfF-min(dfF)+raise; plot(time, dfF, 'k') if fn == 1 hold on end raise = raise+range(dfF)+0.1; end hold off xlabel('Time(s)'); ylabel('Cell Number'); set(gca, 'FontName', 'Arial', 'FontSize', 12)