From 184ab6e732e3464e41b2c06103265075a5e6b17d Mon Sep 17 00:00:00 2001 From: Famous Date: Sun, 1 Mar 2026 02:12:31 +0530 Subject: [PATCH 1/5] 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/5] [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 From 0ee91ed495892a23d8dabe078b3d01f6ddc382dd Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 2 Mar 2026 10:42:39 -0500 Subject: [PATCH 3/5] Add bugfix documentation for issue 13708 --- doc/changes/dev/{13700.bugfix.rst => 13708.bugfix.rst} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename doc/changes/dev/{13700.bugfix.rst => 13708.bugfix.rst} (89%) diff --git a/doc/changes/dev/13700.bugfix.rst b/doc/changes/dev/13708.bugfix.rst similarity index 89% rename from doc/changes/dev/13700.bugfix.rst rename to doc/changes/dev/13708.bugfix.rst index 9fd1d35aefb..ae4242244fb 100644 --- a/doc/changes/dev/13700.bugfix.rst +++ b/doc/changes/dev/13708.bugfix.rst @@ -1 +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 +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`. From 5eadc9acdb623d19b1b05a5a59c87e14bbfd0630 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 2 Mar 2026 12:07:08 -0600 Subject: [PATCH 4/5] Update doc/changes/dev/13708.bugfix.rst --- doc/changes/dev/13708.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/dev/13708.bugfix.rst b/doc/changes/dev/13708.bugfix.rst index ae4242244fb..db8ad284289 100644 --- a/doc/changes/dev/13708.bugfix.rst +++ b/doc/changes/dev/13708.bugfix.rst @@ -1 +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`. +Fix axis label overlap and rendering issues in :func:`~mne.viz.plot_volume_source_estimates`, by :newcontrib:`Famous Raj Bhat`. From ef25e054c566504c4c9b7dbfcf35ec6fab7b668e Mon Sep 17 00:00:00 2001 From: Famous Date: Tue, 3 Mar 2026 00:58:45 +0530 Subject: [PATCH 5/5] Address review feedback: rename changelog, fix author name --- doc/changes/dev/13708.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/dev/13708.bugfix.rst b/doc/changes/dev/13708.bugfix.rst index db8ad284289..3137c690a25 100644 --- a/doc/changes/dev/13708.bugfix.rst +++ b/doc/changes/dev/13708.bugfix.rst @@ -1 +1 @@ -Fix axis label overlap and rendering issues in :func:`~mne.viz.plot_volume_source_estimates`, by :newcontrib:`Famous Raj Bhat`. +Fix axis label overlap in :func:`~mne.viz.plot_volume_source_estimates` by replacing ``canvas.draw()`` with ``canvas.draw_idle()``, by :newcontrib:`Famous077`. \ No newline at end of file