Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed Oct 4, 2023
1 parent 45eaefe commit dd91e05
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/spikeanalysis/spike_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit dd91e05

Please sign in to comment.