4
4
import seaborn as sns
5
5
6
6
7
- def plot_raster (units , spike_times ) -> matplotlib .figure .Figure :
7
+ def plot_raster (units : np .ndarray , spike_times : np .ndarray ) -> matplotlib .figure .Figure :
8
+ """Population raster plots.
8
9
10
+ Args:
11
+ units (np.ndarray): Recorded units.
12
+ spike_times (np.ndarray): Spike timestamps in seconds.
13
+
14
+ Returns:
15
+ matplotlib.figure.Figure: matplotlib figure object.
16
+ """
9
17
units = np .arange (1 , len (units ) + 1 )
10
18
x = np .hstack (spike_times )
11
19
y = np .hstack ([np .full_like (s , u ) for u , s in zip (units , spike_times )])
@@ -26,6 +34,16 @@ def plot_raster(units, spike_times) -> matplotlib.figure.Figure:
26
34
def plot_driftmap (
27
35
spike_times : np .ndarray , spike_depths : np .ndarray , colormap = "gist_heat_r"
28
36
) -> matplotlib .figure .Figure :
37
+ """Plot unit activity drift map all units recorded in a given shank of a probe.
38
+
39
+ Args:
40
+ spike_times (np.ndarray): Spike timestamps in seconds.
41
+ spike_depths (np.ndarray): The depth of the electrode where the spike was found in μm.
42
+ colormap (str, optional): Colormap. Defaults to "gist_heat_r".
43
+
44
+ Returns:
45
+ matplotlib.figure.Figure: matplotlib figure object.
46
+ """
29
47
30
48
spike_times = np .hstack (spike_times )
31
49
spike_depths = np .hstack (spike_depths )
@@ -81,4 +99,4 @@ def plot_driftmap(
81
99
ax_spkcount .set_ylim (depth_edges [0 ], depth_edges [- 1 ])
82
100
sns .despine ()
83
101
84
- return fig
102
+ return fig
0 commit comments