Skip to content

BUG: raw.plot_psd(ax=ax) does not plot into ax #11772

@larsoner

Description

@larsoner

For me both of these are permitted but neither plots into the correct axes, both pop up a new figure:

>>> import mne
>>> import matplotlib.pyplot as plt
>>> raw = mne.io.read_raw_fif(mne.datasets.testing.data_path() / 'MEG' / 'sample' / 'sample_audvis_trunc_raw.fif').pick('eeg')
>>> fig, ax = plt.subplots()
>>> raw.plot_psd(axes=ax)
<MNELineFigure size 1000x350 with 2 Axes>
>>> raw.plot_psd(ax=ax)
<MNELineFigure size 1000x350 with 2 Axes>
>>> print(len(plt.get_fignums()))
3

Based on the 1.0 docs for example ax=ax should plot into the existing ax and axes=... should raise for invalid keyword.

@drammock can you look?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions