From 0cfa6bf98d169882175ad356812f30c1f4722fcc Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 30 Aug 2025 00:42:30 -0400 Subject: [PATCH 1/4] Backport PR #30492: DOC: pytz link should be from PyPI --- doc/install/dependencies.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/dependencies.rst b/doc/install/dependencies.rst index 3034a64a3361..c97dcdd64444 100644 --- a/doc/install/dependencies.rst +++ b/doc/install/dependencies.rst @@ -370,7 +370,7 @@ them will be skipped by pytest. .. _pandas: https://pypi.org/project/pandas/ .. _pikepdf: https://pypi.org/project/pikepdf/ .. _psutil: https://pypi.org/project/psutil/ -.. _pytz: https://fonts.google.com/noto/use#faq +.. _pytz: https://pypi.org/project/pytz/ .. _pytest-cov: https://pytest-cov.readthedocs.io/en/latest/ .. _pytest-flake8: https://pypi.org/project/pytest-flake8/ .. _pytest-timeout: https://pypi.org/project/pytest-timeout/ From e8eac49c6c2bd8dcc4dd8aec9cd88130b7492236 Mon Sep 17 00:00:00 2001 From: Aasma Gupta Date: Tue, 2 Sep 2025 22:13:29 +0530 Subject: [PATCH 2/4] Backport PR #30490: Fix SVG rendering error in def update_background --- lib/matplotlib/widgets.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 631ada38027a..6a3c0d684380 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2157,6 +2157,8 @@ def update_background(self, event): # `release` can call a draw event even when `ignore` is True. if not self.useblit: return + if self.canvas.is_saving(): + return # saving does not use blitting # Make sure that widget artists don't get accidentally included in the # background, by re-rendering the background if needed (and then # re-re-rendering the canvas with the visible widget artists). From 155b19c2bdb8e0e9620eadfdb9fc32a6be9b52df Mon Sep 17 00:00:00 2001 From: David Stansby Date: Fri, 5 Sep 2025 08:44:43 +0100 Subject: [PATCH 3/4] Backport PR #30497: TST: Use a temporary directory for test_save_figure_return --- lib/matplotlib/tests/test_backend_qt.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_qt.py b/lib/matplotlib/tests/test_backend_qt.py index 962f5ce94206..1012b16f0212 100644 --- a/lib/matplotlib/tests/test_backend_qt.py +++ b/lib/matplotlib/tests/test_backend_qt.py @@ -219,14 +219,15 @@ def test_figureoptions(): @pytest.mark.backend('QtAgg', skip_on_importerror=True) -def test_save_figure_return(): +def test_save_figure_return(tmp_path): fig, ax = plt.subplots() ax.imshow([[1]]) + expected = tmp_path / "foobar.png" prop = "matplotlib.backends.qt_compat.QtWidgets.QFileDialog.getSaveFileName" - with mock.patch(prop, return_value=("foobar.png", None)): + with mock.patch(prop, return_value=(str(expected), None)): fname = fig.canvas.manager.toolbar.save_figure() - os.remove("foobar.png") - assert fname == "foobar.png" + assert fname == str(expected) + assert expected.exists() with mock.patch(prop, return_value=(None, None)): fname = fig.canvas.manager.toolbar.save_figure() assert fname is None From 56b2dcc6560804eff7b62a939792576859f45e66 Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Wed, 10 Sep 2025 07:11:54 +0100 Subject: [PATCH 4/4] Backport PR #30539: Fix scale_unit/scale_units typo in quiver docs --- lib/matplotlib/quiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index e66f1f97b21f..b9963b0e1716 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -144,7 +144,7 @@ length in y direction = $\\frac{v}{\\mathrm{scale}} \\mathrm{scale_unit}$ - For example, ``(u, v) = (0.5, 0)`` with ``scale=10, scale_unit="width"`` results + For example, ``(u, v) = (0.5, 0)`` with ``scale=10, scale_units="width"`` results in a horizontal arrow with a length of *0.5 / 10 * "width"*, i.e. 0.05 times the Axes width.