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

viz.plot_sensors() only partially honors axes parameter #7850

Closed
hoechenberger opened this issue May 29, 2020 · 2 comments · Fixed by #8536
Closed

viz.plot_sensors() only partially honors axes parameter #7850

hoechenberger opened this issue May 29, 2020 · 2 comments · Fixed by #8536

Comments

@hoechenberger
Copy link
Member

hoechenberger commented May 29, 2020

Describe the bug

I wanted to add sensor alignment plots via Raw.plot_sensors() to some subplots of a larger figure. While the sensors are getting plotted, I observe some very annoying side effects that imho qualify as bugs.

Steps to reproduce

import matplotlib.pyplot as plt
import mne
from mne.datasets import sample

data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)

fig, ax = plt.subplots(2, 2)

ax[0, 0].plot(range(10))
ax[0, 0].set_title('Title A')

ax[1, 0].plot(range(10))
ax[1, 0].set_title('Title B')

raw.plot_sensors(ch_type='mag', axes=ax[0, 1])
raw.plot_sensors(ch_type='grad', axes=ax[1, 1])

Expected results

All subplots should appear in their designated axes.

Actual results

Figure_1

  • First sensor plot doesn't have a title
  • Second sensor plot's title appears as suptitle while it should be an axes title
  • The entire figure appears to be truncated at the top, left, and bottom

Additional information

The behavior reminds me somewhat of #7595, which has been fixed by @drammock in #7706.

I'm using Matplotlibs Qt backend on macOS.

@hoechenberger
Copy link
Member Author

There also seems to be an issue with the "click on sensors" callback, which is linked across BOTH sensor subplots…

@agramfort
Copy link
Member

agramfort commented May 29, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants