Skip to content

Commit

Permalink
Fix grid plots
Browse files Browse the repository at this point in the history
  • Loading branch information
b-grimaud committed Sep 30, 2024
1 parent 85ed18c commit 8240e9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/MEArec/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,7 @@ def plot_templates(
else:
colors = plt.rcParams["axes.prop_cycle"].by_key()["color"]

gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())

for i_n, n in enumerate(template_ids):
r = i_n // ncols
Expand Down Expand Up @@ -3318,7 +3318,7 @@ def plot_waveforms(
nrows = 1
ncols = n_units

gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())

for i, wf in enumerate(waveforms):
r = i // ncols
Expand All @@ -3336,7 +3336,7 @@ def plot_waveforms(
nrows = 1
ncols = len(spiketrain_id)

gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())

# find ylim
min_wf = 0
Expand Down Expand Up @@ -3488,7 +3488,7 @@ def plot_amplitudes(
nrows = 1
ncols = n_units

gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())

for i_n, n in enumerate(spiketrain_id):
r = i_n // ncols
Expand Down Expand Up @@ -3626,7 +3626,7 @@ def plot_pca_map(

nrows = len(pc_dims) * len(elec_dims)
ncols = nrows
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())

for p1 in pc_dims:
for i1, ch1 in enumerate(elec_dims):
Expand Down

0 comments on commit 8240e9f

Please sign in to comment.