From dd91e050905142fc5ba3af80f24f01e47e08006d Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:29:34 -0400 Subject: [PATCH] add docstrings --- src/spikeanalysis/spike_plotter.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/spikeanalysis/spike_plotter.py b/src/spikeanalysis/spike_plotter.py index 6360843..048e90f 100644 --- a/src/spikeanalysis/spike_plotter.py +++ b/src/spikeanalysis/spike_plotter.py @@ -733,6 +733,24 @@ def plot_response_trace( ebar: bool = False, color="black", ): + """ + Function for plotting response traces for either z scored or raw firing rates + + Parameters + ---------- + type: Literal['zscore', 'raw'], default: 'zscore' + Whether to generate traces with zscored data or raw firing rate data + by_neuron: bool, default: False + Whether to plot each neuron separate (True) or average over all neurons (False) + by_trial: bool, default: False + Whether to plot each trial separately (True) or average over all neurons (False) + ebar: bool, default: False + Whether to include error bars in the traces + color: matplotlib color, default: 'black' + Color to plot the traces in + + """ + assert type in ["zscore", "raw"], "type of data must be zscore or raw" if type == "zscore": @@ -774,6 +792,10 @@ def plot_response_trace( self._plot_one_trace(current_bins, avg_response, ebars=None, color=color, stim=stimulus) def _plot_one_trace(self, bins, trace, ebars=None, color="black", stim=""): + """ + Function for plotting one response trace in 2D. I'm going to try + to let it autoscale + """ fig, ax = plt.subplots(figsize=self.figsize) ax.plot(bins, trace, color=color) if ebars is not None: