Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix grid plots on newer matplotlib versions #173

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading