Skip to content

[BUG] fix axis label overlap in plot_volume_source_estimates by using draw_idle()#13708

Open
Famous077 wants to merge 2 commits intomne-tools:mainfrom
Famous077:fix/volume-plot-axis-labels-blitting
Open

[BUG] fix axis label overlap in plot_volume_source_estimates by using draw_idle()#13708
Famous077 wants to merge 2 commits intomne-tools:mainfrom
Famous077:fix/volume-plot-axis-labels-blitting

Conversation

@Famous077
Copy link

@Famous077 Famous077 commented Feb 28, 2026

Fixed issue #13700

Problem

When plotting volume source estimates, axis labels were mangled and
overlapping on the colorbar and y-axis of the time series plot.
The MRI and colorbar also appeared shifted relative to the black background.

Root Cause

canvas.draw() was being called after each click/keypress event in
_press() and _onclick(), causing blitting artifacts when combined
with nilearn's plotting functions.

Fix

Replaced canvas.draw() with canvas.draw_idle() in both _press()
and _onclick() functions in mne/viz/_3d.py. This lets matplotlib
schedule the redraw properly and avoids the rendering artifacts.

Changes

  • mne/viz/_3d.py: canvas.draw()canvas.draw_idle() in _press() and _onclick()
  • doc/changes/dev/13700.bugfix.rst: changelog entry
  • doc/changes/names.inc: added contributor name

@Famous077 Famous077 changed the title [BUG]: fix axis label overlap in plot_volume_source_estimates by using draw_idle() [BUG] fix axis label overlap in plot_volume_source_estimates by using draw_idle() Feb 28, 2026
@Famous077
Copy link
Author

All tests in mne/viz/tests/test_3d_mpl.py pass locally.
The 2 CI failures appear to be Azure Pipelines infrastructure
issues, unrelated to this change. Waiting for your review whenever you get a chance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant