From 184ab6e732e3464e41b2c06103265075a5e6b17d Mon Sep 17 00:00:00 2001 From: Famous Date: Sun, 1 Mar 2026 02:12:31 +0530 Subject: [PATCH 1/2] BUG: fix axis label overlap in plot_volume_source_estimates by using draw_idle() --- doc/changes/dev/13700.bugfix.rst | 1 + doc/changes/names.inc | 2 ++ mne/viz/_3d.py | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 doc/changes/dev/13700.bugfix.rst diff --git a/doc/changes/dev/13700.bugfix.rst b/doc/changes/dev/13700.bugfix.rst new file mode 100644 index 00000000000..9fd1d35aefb --- /dev/null +++ b/doc/changes/dev/13700.bugfix.rst @@ -0,0 +1 @@ +Fix axis label overlap and rendering issues in :func:`~mne.viz.plot_volume_source_estimates` by replacing ``canvas.draw()`` with ``canvas.draw_idle()`` to avoid blitting artifacts, by :newcontrib:`Famous Raj Bhat`. \ No newline at end of file diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 09c5818b6af..400a14e08e5 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -364,3 +364,5 @@ .. _Zhi Zhang: https://github.com/tczhangzhi/ .. _Ziyi ZENG: https://github.com/ZiyiTsang .. _Zvi Baratz: https://github.com/ZviBaratz + +.. _Famous Raj Bhat: https://github.com/Famous077 diff --git a/mne/viz/_3d.py b/mne/viz/_3d.py index 080fb69d71f..5dd6f975037 100644 --- a/mne/viz/_3d.py +++ b/mne/viz/_3d.py @@ -2870,7 +2870,7 @@ def _press(event, params): elif event.key == "shift+right": idx = min(params["stc"].shape[1] - 1, idx + 10) _update_timeslice(idx, params) - params["fig"].canvas.draw() + params["fig"].canvas.draw_idle() def _update_timeslice(idx, params): @@ -2921,7 +2921,7 @@ def _onclick(event, params, verbose=None): else: params["ax_time"].lines[0].set_ydata([0.0]) _update_vertlabel(loc_idx, params) - params["fig"].canvas.draw() + params["fig"].canvas.draw_idle() def _cut_coords_to_idx(cut_coords, dist_to_verts): From b6ed86aa38ef9548fe344a33d497335a3743deba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 20:46:14 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/changes/names.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 400a14e08e5..c6b4b00c499 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -96,6 +96,7 @@ .. _Ezequiel Mikulan: https://github.com/ezemikulan .. _Ezequiel Mikulan: https://github.com/ezemikulan .. _Fahimeh Mamashli: https://github.com/fmamashli +.. _Famous Raj Bhat: https://github.com/Famous077 .. _Farzin Negahbani: https://github.com/Farzin-Negahbani .. _Federico Raimondo: https://github.com/fraimondo .. _Federico Zamberlan: https://github.com/fzamberlan @@ -364,5 +365,3 @@ .. _Zhi Zhang: https://github.com/tczhangzhi/ .. _Ziyi ZENG: https://github.com/ZiyiTsang .. _Zvi Baratz: https://github.com/ZviBaratz - -.. _Famous Raj Bhat: https://github.com/Famous077