Skip to content

Commit

Permalink
Merge pull request #173 from b-grimaud/main
Browse files Browse the repository at this point in the history
Fix grid plots on newer matplotlib versions
  • Loading branch information
alejoe91 authored Oct 3, 2024
2 parents 85ed18c + 8240e9f commit 38ba7b4
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 38ba7b4

Please sign in to comment.