Visualize Rate Statistics of rBCBG firing rates

Functions

Purpose

plot_rate_all_neurons_in_ax()

plots Rate (1/s) of each neurons in a population into a given matplotlib.pyplot.axis

plot_mean_rate_in_ax()

draws the Mean Rate (1/s) of all the neurons into a given matplotlib.pyplot.axis

Plot Mean Rate

1. Pre-requisites

1.1. Import Modules

from analyseur.rbcbg.loader import LoadRates
from analyseur.rbcbg.visual.rate import plot_rate_all_neurons_in_ax, plot_mean_rate_in_ax

1.2. Load file and get firing rates

loadFR = LoadRates("GPiSNr_model_9_percent_0.csv")
t_sec, rates_Hz = loadFR.get_rates()

2. Cases

2.1. Visualize All Firing Rates with default setting

fig, ax = plt.subplots(figsize=(6, 10))

ax = plot_rate_all_neurons_in_ax(ax, t_sec, rates_Hz, nucleus="GPiSNr")

plt.show()

2.2. Visualize All Firing Rates within a desired window

window = (0,1)  # first second

fig, ax = plt.subplots(figsize=(6, 10))

ax = plot_rate_all_neurons_in_ax(ax, t_sec, rates_Hz, nucleus="GPiSNr", window=window)

plt.show()

2.3. Visualize Mean Firing rate

fig, ax = plt.subplots(figsize=(6, 10))

ax = plot_mean_rate_in_ax(ax, t_sec, rates_Hz, nucleus="GPiSNr")

plt.show()

analyseur.rbcbg.visual.rate.plot_mean_rate_in_ax(ax, times_array, rates_array, nucleus=None, window=None)[source]
Firing Rate (Hz)
│
│ 0.4 ┤      ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~
│     │     ~     ~     ~     ~     ~
│ 0.3 ┤    ~       ~   ~       ~   ~
│     │   ~         ~ ~         ~ ~
│ 0.2 ┤~~~           ~           ~~~~~~~
│     │  ~
│     │   ~
│ 0.1 ┤    ~
│     │
│ 0.0 ┼────┴────────────────────────────────────→ Time (s)
        0        2        4        6        8

Given a matplotlib.pyplot.axis this draws the firing rates (1/s) averaged across all neurons in a given population

Parameters:
  • ax – object matplotlib.pyplot.axis

  • times_array – array returned using get_rates()

  • mu_rate_array – array returned using get_rates()

[OPTIONAL]

Parameters:
  • nucleus – string; name of the nucleus

  • window – Tuple in the form (start_time, end_time); (0, 10) [default]

Returns:

ax with respective plotting


analyseur.rbcbg.visual.rate.plot_rate_all_neurons_in_ax(ax, times_array, rates_array, nucleus=None, window=None)[source]
Firing Rate (Hz)
│
│ 0.4 ┤      ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~
│     │     ~~~~~~ ~~~~~~ ~~~~~~ ~~~~~~
│     │    ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~
│ 0.3 ┤   ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~
│     │  ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~
│     │ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~
│ 0.2 ┤~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~
│     │ ~~~~~~~~~  ~~~~~~~~~  ~~~~~~~~~  ~~~~~~~~
│     │  ~~~~~~~~   ~~~~~~~~   ~~~~~~~~   ~~~~~~~
│ 0.1 ┤   ~~~~~~     ~~~~~~     ~~~~~~     ~~~~~
│     │     ~
│     │    ~
│ 0.0 ┼────┴────────────────────────────────────→ Time (s)
        0        2        4        6        8       10

(many neurons → overlapping oscillatory traces with slight offsets)

Given a matplotlib.pyplot.axis this draws the firing rates (1/s) for each neurons in a given population

Parameters:
  • ax – object matplotlib.pyplot.axis

  • times_array – array returned using get_rates()

  • mu_rate_array – array returned using get_rates()

[OPTIONAL]

Parameters:
  • nucleus – string; name of the nucleus

  • window – Tuple in the form (start_time, end_time); (0, 10) [default]

Returns:

ax with respective plotting