From 09fde06b0dd57dee86640f6faa751840db201f6a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 25 Jul 2025 16:51:48 -0400 Subject: [PATCH 001/210] GOV: change CoC from Contributor Covenant to NumFOCUS CoC This also changes the reporting from Matplotlib specific CoC committee to the NumFOCUS Code of Conduct Working group. --- doc/project/code_of_conduct.rst | 168 +++++++------------------------- 1 file changed, 36 insertions(+), 132 deletions(-) diff --git a/doc/project/code_of_conduct.rst b/doc/project/code_of_conduct.rst index 56fee2f25f6f..c2b3149ca07a 100644 --- a/doc/project/code_of_conduct.rst +++ b/doc/project/code_of_conduct.rst @@ -1,148 +1,52 @@ .. _code_of_conduct: .. redirect-from:: /users/project/code_of_conduct -==================================== -Contributor Covenant Code of Conduct -==================================== +======================== +NUMFOCUS CODE OF CONDUCT +======================== -Our Pledge -========== +You can find the whole document here +https://numfocus.org/code-of-conduct. -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. +THE SHORT VERSION +================= -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. +NumFOCUS is dedicated to providing a harassment-free community for +everyone, regardless of gender, sexual orientation, gender identity and +expression, disability, physical appearance, body size, race, or +religion. We do not tolerate harassment of community members in any +form. -Our Standards -============= - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -Enforcement Responsibilities -============================ - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -Scope -===== - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -Enforcement -=========== - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -`matplotlib-coc@numfocus.org `_ which is -monitored by the `CoC subcommittee `_ or a -report can be made using the `NumFOCUS Code of Conduct report form `_. -If community leaders cannot come to a resolution about enforcement, -reports will be escalated to the NumFocus Code of Conduct committee -(conduct@numfocus.org). All complaints will be reviewed and investigated -promptly and fairly. +Be kind to others. Do not insult or put down others. Behave +professionally. Remember that harassment and sexist, racist, or +exclusionary jokes are not appropriate for NumFOCUS. -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. +All communication should be appropriate for a professional audience +including people of many different backgrounds. Sexual language and +imagery is not appropriate. -Enforcement Guidelines -====================== +Thank you for helping make this a welcoming, friendly community for all. -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: +LONG VERSION +============ -1. Correction -------------- +You can find the long version of the Code of Conduct on the NumFOCUS +website https://numfocus.org/code-of-conduct -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -2. Warning ----------- - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -3. Temporary Ban ----------------- - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -4. Permanent Ban ----------------- - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -Attribution -=========== +HOW TO REPORT +============= -This Code of Conduct is adapted from the `Contributor Covenant `_, -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +If you feel that the Code of Conduct has been violated, feel free to +submit a report, by using the form: `NumFOCUS Code of Conduct Reporting +Form `__ -Community Impact Guidelines were inspired by `Mozilla's code of conduct -enforcement ladder `_. +WHO WILL RECEIVE YOUR REPORT +============================ +Your report will be received and handled by NumFOCUS Code of Conduct +Working Group; trained, and experienced contributors with diverse +backgrounds. The group is making decisions independently from the +project, PyData, NumFOCUS or any other organization. -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +You can learn more about the current group members, as well as the +reporting procedure `HERE `__ From bf03b202ada7d1109b79441dfa823b3204fe0f24 Mon Sep 17 00:00:00 2001 From: Gabriel Silva Date: Wed, 1 Apr 2026 17:45:59 +0100 Subject: [PATCH 002/210] ENH: Extend gouraud shading to support data at quad centers * Extend the gouraud shading in Axes.pcolormesh to support data defined at the centers of quadrilaterals, where X and Y are one larger than Z in each dimension. In this situation, gouraud automatically converts the grid to match the data's shape by replacing each quadrilateral with a point at its center, computed as the average of its four corners, and then applies Gouraud shading. * Add tests. * Add and update documentation. * Add a What's New entry. --- .../next_whats_new/pcolormesh_gouraud.rst | 52 +++++++++++++++++++ .../pcolormesh_grids.py | 17 +++++- lib/matplotlib/axes/_axes.py | 31 +++++++---- lib/matplotlib/tests/test_axes.py | 38 +++++++++++++- 4 files changed, 125 insertions(+), 13 deletions(-) create mode 100644 doc/release/next_whats_new/pcolormesh_gouraud.rst diff --git a/doc/release/next_whats_new/pcolormesh_gouraud.rst b/doc/release/next_whats_new/pcolormesh_gouraud.rst new file mode 100644 index 000000000000..089e4a8bc639 --- /dev/null +++ b/doc/release/next_whats_new/pcolormesh_gouraud.rst @@ -0,0 +1,52 @@ +``gouraud`` shading supports data at quadrilaterals centers +----------------------------------------------------------- + +`~.Axes.pcolormesh` previously required data at the corners of +quadrilaterals for ``gouraud`` shading. It now also supports data +defined at the centers of quadrilaterals. + +This now allows `~.Axes.pcolormesh` to provide both constant and +linearly interpolated shading for each data location. + +=============== ======== ===================== +.. constant linearly interpolated +=============== ======== ===================== +data at corners nearest gouraud +data at centers flat gouraud +=============== ======== ===================== + +Shading can be switched for the same data location, allowing +switches between ``nearest`` and ``gouraud``, and now also +between ``flat`` and ``gouraud``. + +For example: + +.. plot:: + :include-source: true + :alt: Switching between constant and linearly interpolated shading for data at corners and centers. + + import matplotlib.pyplot as plt + import numpy as np + + nrows, ncols = 3, 5 + Z = np.arange(nrows * ncols).reshape(nrows, ncols) + x = np.arange(ncols + 1) + y = np.arange(nrows + 1) + + fig, axs = plt.subplots(2, 2, layout='constrained') + + # Data at corners, requires X and Y the same shape as Z. + axs[0, 0].pcolormesh(x[:-1], y[:-1], Z, shading='nearest') + axs[0, 0].set_title('nearest: X, Y, Z same shape') + + axs[0, 1].pcolormesh(x[:-1], y[:-1], Z, shading='gouraud') + axs[0, 1].set_title('gouraud: X, Y, Z same shape') + + # Data at centers, requires X and Y one larger than Z. + axs[1, 0].pcolormesh(x, y, Z, shading='flat') + axs[1, 0].set_title('flat: X, Y one larger than Z') + + axs[1, 1].pcolormesh(x, y, Z, shading='gouraud') + axs[1, 1].set_title('gouraud: X, Y one larger than Z') + + plt.show() diff --git a/galleries/examples/images_contours_and_fields/pcolormesh_grids.py b/galleries/examples/images_contours_and_fields/pcolormesh_grids.py index 212b807dbf90..527c954d6f87 100644 --- a/galleries/examples/images_contours_and_fields/pcolormesh_grids.py +++ b/galleries/examples/images_contours_and_fields/pcolormesh_grids.py @@ -108,7 +108,8 @@ def _annotate(ax, x, y, title): # # `Gouraud shading `_ can also # be specified, where the color in the quadrilaterals is linearly interpolated -# between the grid points. The shapes of *X*, *Y*, *Z* must be the same. +# between the grid points. The data is specified at the corners of the +# quadrilaterals, in which case *X*, *Y* and *Z* are all the same shape. fig, ax = plt.subplots(layout='constrained') x = np.arange(ncols) @@ -116,6 +117,20 @@ def _annotate(ax, x, y, title): ax.pcolormesh(x, y, Z, shading='gouraud', vmin=Z.min(), vmax=Z.max()) _annotate(ax, x, y, "shading='gouraud'; X, Y same shape as Z") +# %% +# Gouraud Shading, one larger grid +# -------------------------------- +# In some cases, the user has data defined at the centers of the quadrilaterals +# with *X* and *Y* one larger than *Z*. ``shading='gouraud'`` also supports +# this, and automatically converts the grid to match the shape of *Z* +# by replacing each quadrilateral with a single point at its center. + +fig, ax = plt.subplots(layout='constrained') +x = np.arange(ncols + 1) +y = np.arange(nrows + 1) +ax.pcolormesh(x, y, Z, shading='gouraud', vmin=Z.min(), vmax=Z.max()) +_annotate(ax, x, y, "shading='gouraud'; X, Y one larger than Z") + plt.show() # %% # diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 6102fd3d3ed3..650c08494c5f 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6523,9 +6523,13 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs): f" see help({funcname})") else: # ['nearest', 'gouraud']: if (Nx, Ny) != (ncols, nrows): - raise TypeError('Dimensions of C %s are incompatible with' - ' X (%d) and/or Y (%d); see help(%s)' % ( - C.shape, Nx, Ny, funcname)) + if shading == 'gouraud' and (Nx, Ny) == (ncols + 1, nrows + 1): + # the center of each quad is the average of its four corners + X = 0.25 * (X[:-1, :-1] + X[:-1, 1:] + X[1:, 1:] + X[1:, :-1]) + Y = 0.25 * (Y[:-1, :-1] + Y[:-1, 1:] + Y[1:, 1:] + Y[1:, :-1]) + else: + raise TypeError(f"Dimensions of C {C.shape} are incompatible with" + f" X ({Nx}) and/or Y ({Ny}); see help({funcname})") if shading == 'nearest': # grid is specified at the center, so define corners # at the midpoints between the grid centers and then use the @@ -6818,11 +6822,17 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, greater than those of *C*, otherwise a TypeError is raised. The quadrilateral is colored due to the value at ``C[i, j]``. - If ``shading='nearest'`` or ``'gouraud'``, the dimensions of *X* - and *Y* should be the same as those of *C* (if not, a TypeError - will be raised). For ``'nearest'`` the color ``C[i, j]`` is - centered on ``(X[i, j], Y[i, j])``. For ``'gouraud'``, a smooth - interpolation is carried out between the quadrilateral corners. + If ``shading='nearest'`` the dimensions of *X* and *Y* should be + the same as those of *C*, otherwise a TypeError is raised. The + color ``C[i, j]`` is centered on ``(X[i, j], Y[i, j])``. + + If ``shading='gouraud'`` the dimensions of *X* and *Y* should be + the same as those of *C* or be one greater than those of *C*, + otherwise a TypeError is raised. If the dimensions of *X* and *Y* + are one greater, they are automatically converted to match the shape + of *C* by replacing each quadrilateral with a point at its center, + computed as the average of their four corners. In both cases a + smooth interpolation is carried out between the quadrilateral corners. If *X* and/or *Y* are 1-D arrays or column vectors they will be expanded as needed into the appropriate 2D arrays, making a @@ -6864,8 +6874,9 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, - 'gouraud': Each quad will be Gouraud shaded: The color of the corners (i', j') are given by ``C[i', j']``. The color values of the area in between is interpolated from the corner values. - The dimensions of *X* and *Y* must be the same as *C*. When - Gouraud shading is used, *edgecolors* is ignored. + If the dimensions of *X* and *Y* are one greater, the grid is + automatically converted to match the shape of *C*. + When Gouraud shading is used, *edgecolors* is ignored. - 'auto': Choose 'flat' if dimensions of *X* and *Y* are one larger than *C*. Choose 'nearest' if dimensions are the same. diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 2e3abec8363e..ac3653f031b5 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1623,6 +1623,40 @@ def test_pcolor_log_scale(fig_test, fig_ref): ax.set_xscale('log') +def test_pcolormesh_switching_shadings(): + nrows, ncols = 3, 4 + Z = np.arange(nrows * ncols).reshape(nrows, ncols) + x = np.arange(ncols + 1) + y = np.arange(nrows + 1) + + _, ax = plt.subplots() + + ax.pcolormesh(x, y, Z, shading='flat') + ax.pcolormesh(x, y, Z, shading='gouraud') + with pytest.raises(TypeError): + ax.pcolormesh(x, y, Z, shading='nearest') + + ax.pcolormesh(x[:-1], y[:-1], Z, shading='nearest') + ax.pcolormesh(x[:-1], y[:-1], Z, shading='gouraud') + with pytest.raises(TypeError): + ax.pcolormesh(x[:-1], y[:-1], Z, shading='flat') + + +@check_figures_equal() +def test_pcolormesh_gouraud_grid_conversion(fig_test, fig_ref): + Z = np.arange(6).reshape(2, 3) + + x_test = np.array([0, 2, 8, 12]) + y_test = np.array([0, 2, 6]) + ax_test = fig_test.subplots() + ax_test.pcolormesh(x_test, y_test, Z, shading='gouraud') + + x_ref = np.array([1, 5, 10]) + y_ref = np.array([1, 4]) + ax_ref = fig_ref.subplots() + ax_ref.pcolormesh(x_ref, y_ref, Z, shading='gouraud') + + def test_pcolorargs(): n = 12 x = np.linspace(-1.5, 1.5, n) @@ -1636,9 +1670,9 @@ def test_pcolorargs(): with pytest.raises(TypeError): ax.pcolormesh(X, Y, Z.T) with pytest.raises(TypeError): - ax.pcolormesh(x, y, Z[:-1, :-1], shading="gouraud") + ax.pcolormesh(x, y, Z[:-2, :-2], shading='gouraud') with pytest.raises(TypeError): - ax.pcolormesh(X, Y, Z[:-1, :-1], shading="gouraud") + ax.pcolormesh(X, Y, Z[:-2, :-2], shading='gouraud') x[0] = np.nan with pytest.raises(ValueError): ax.pcolormesh(x, y, Z[:-1, :-1]) From 6fbb514191f84759eb7238421185b5cc0f3337af Mon Sep 17 00:00:00 2001 From: Gabriel Silva Date: Tue, 28 Apr 2026 12:09:26 +0100 Subject: [PATCH 003/210] DOC: Clarify gouraud shading --- .../pcolormesh_grids.py | 5 +++-- lib/matplotlib/axes/_axes.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/galleries/examples/images_contours_and_fields/pcolormesh_grids.py b/galleries/examples/images_contours_and_fields/pcolormesh_grids.py index 527c954d6f87..506ddbcb0aa6 100644 --- a/galleries/examples/images_contours_and_fields/pcolormesh_grids.py +++ b/galleries/examples/images_contours_and_fields/pcolormesh_grids.py @@ -120,10 +120,11 @@ def _annotate(ax, x, y, title): # %% # Gouraud Shading, one larger grid # -------------------------------- +# # In some cases, the user has data defined at the centers of the quadrilaterals # with *X* and *Y* one larger than *Z*. ``shading='gouraud'`` also supports -# this, and automatically converts the grid to match the shape of *Z* -# by replacing each quadrilateral with a single point at its center. +# this by using the grid quadrilateral centers as the corners of each colored +# quadrilateral. fig, ax = plt.subplots(layout='constrained') x = np.arange(ncols + 1) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 650c08494c5f..15e9d70faca3 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6829,7 +6829,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, If ``shading='gouraud'`` the dimensions of *X* and *Y* should be the same as those of *C* or be one greater than those of *C*, otherwise a TypeError is raised. If the dimensions of *X* and *Y* - are one greater, they are automatically converted to match the shape + are one greater, they are internally converted to match the shape of *C* by replacing each quadrilateral with a point at its center, computed as the average of their four corners. In both cases a smooth interpolation is carried out between the quadrilateral corners. @@ -6871,11 +6871,15 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, - 'nearest': Each grid point will have a color centered on it, extending halfway between the adjacent grid centers. The dimensions of *X* and *Y* must be the same as *C*. - - 'gouraud': Each quad will be Gouraud shaded: The color of the - corners (i', j') are given by ``C[i', j']``. The color values of - the area in between is interpolated from the corner values. - If the dimensions of *X* and *Y* are one greater, the grid is - automatically converted to match the shape of *C*. + - 'gouraud': If the mesh data is defined at the corners of grid + quadrilaterals, with *X*, *Y* and *C* having the same dimensions, + each grid quad will be Gouraud shaded. If the color values + are specified at the centers of grid quadrilaterals, *X* and *Y* + have dimensions one greater than those of *C*, and each colored + quadrilateral will use the grid quad centers as its corners, so + that it can be Gouraud shaded: The color of the corners (i', j') + are given by ``C[i', j']``, and the color values of the area + in between are interpolated from the corner values. When Gouraud shading is used, *edgecolors* is ignored. - 'auto': Choose 'flat' if dimensions of *X* and *Y* are one larger than *C*. Choose 'nearest' if dimensions are the same. From 7b5b0d622819b2997310255e933b0e5ce5199fdf Mon Sep 17 00:00:00 2001 From: Gabriel Silva Date: Tue, 30 Jun 2026 23:55:06 +0100 Subject: [PATCH 004/210] DOC: Improve documentation Add explanatory comment in `test_pcolormesh_gouraud_grid_conversion`. Update gallery example to note that gouraud contracts the visualization by half a grid cell when X,Y are one larger than C. Address review feedback. --- .../examples/images_contours_and_fields/pcolormesh_grids.py | 2 +- lib/matplotlib/tests/test_axes.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/galleries/examples/images_contours_and_fields/pcolormesh_grids.py b/galleries/examples/images_contours_and_fields/pcolormesh_grids.py index 506ddbcb0aa6..ce35eba61f02 100644 --- a/galleries/examples/images_contours_and_fields/pcolormesh_grids.py +++ b/galleries/examples/images_contours_and_fields/pcolormesh_grids.py @@ -124,7 +124,7 @@ def _annotate(ax, x, y, title): # In some cases, the user has data defined at the centers of the quadrilaterals # with *X* and *Y* one larger than *Z*. ``shading='gouraud'`` also supports # this by using the grid quadrilateral centers as the corners of each colored -# quadrilateral. +# quadrilateral. This contracts the pseudocolor plot by half a grid cell. fig, ax = plt.subplots(layout='constrained') x = np.arange(ncols + 1) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index ac3653f031b5..bf46237f629a 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1644,13 +1644,17 @@ def test_pcolormesh_switching_shadings(): @check_figures_equal() def test_pcolormesh_gouraud_grid_conversion(fig_test, fig_ref): + # For X and Y one dimension greater than Z, gouraud converts the + # grid representation to match the data shape, by using quad centers. Z = np.arange(6).reshape(2, 3) + # One larger than Z in each dimension. x_test = np.array([0, 2, 8, 12]) y_test = np.array([0, 2, 6]) ax_test = fig_test.subplots() ax_test.pcolormesh(x_test, y_test, Z, shading='gouraud') + # Same shape as Z. x_ref = np.array([1, 5, 10]) y_ref = np.array([1, 4]) ax_ref = fig_ref.subplots() From 9e9e91f4bb76b09617209459095a784d25ad7c06 Mon Sep 17 00:00:00 2001 From: kikeenator <296241541+kikeenator@users.noreply.github.com> Date: Thu, 2 Jul 2026 22:24:49 +0200 Subject: [PATCH 005/210] FIX: fall back to kpsewhich when luatex starts but is unusable find_tex_file only fell back to kpsewhich when the luatex process failed to start. If luatex started but then died or became unusable at runtime, its search() returned an empty result and find_tex_file raised FileNotFoundError without ever trying kpsewhich. Make _LuatexKpsewhich.search() return None when luatex is unusable (a broken pipe or an empty read) and "" when luatex works but the file is missing, and fall back to kpsewhich only when search() returns None, so a genuinely missing file does not trigger a needless kpsewhich call. Closes #31983 --- lib/matplotlib/dviread.py | 20 ++++++--- lib/matplotlib/tests/test_dviread.py | 65 ++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index 979744d1ef5c..628e74845ecc 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -1267,10 +1267,16 @@ def _new_proc(self): def search(self, filename): if self._proc.poll() is not None: # Dead, restart it. self._proc = self._new_proc() - self._proc.stdin.write(os.fsencode(filename) + b"\n") - self._proc.stdin.flush() - out = self._proc.stdout.readline().rstrip() - return None if out == b"nil" else os.fsdecode(out) + try: + self._proc.stdin.write(os.fsencode(filename) + b"\n") + self._proc.stdin.flush() + out = self._proc.stdout.readline().rstrip() + except OSError: # luatex started but is now unusable. + return None + if out == b"": # Empty read: luatex died; unusable. + return None + # "nil" => file missing but luatex works; return "" (not None). + return "" if out == b"nil" else os.fsdecode(out) @lru_cache @@ -1280,7 +1286,8 @@ def find_tex_file(filename): The kpathsea library, provided by most existing TeX distributions, both on Unix-like systems and on Windows (MikTeX), is invoked via a long-lived - luatex process if luatex is installed, or via kpsewhich otherwise. + luatex process if luatex is installed and working, or via kpsewhich + otherwise. .. _kpathsea: https://www.tug.org/kpathsea/ @@ -1304,9 +1311,10 @@ def find_tex_file(filename): except (FileNotFoundError, OSError): lk = None # Fallback to directly calling kpsewhich, as below. + path = None if lk: path = lk.search(filename) - else: + if path is None: # luatex unavailable or unusable; fall back to kpsewhich. if sys.platform == 'win32': # On Windows only, kpathsea can use utf-8 for cmd args and output. # The `command_line_encoding` environment variable is set to force diff --git a/lib/matplotlib/tests/test_dviread.py b/lib/matplotlib/tests/test_dviread.py index 3581a97c1390..6ddb5916c6da 100644 --- a/lib/matplotlib/tests/test_dviread.py +++ b/lib/matplotlib/tests/test_dviread.py @@ -2,6 +2,7 @@ from pathlib import Path import shutil import sys +from unittest import mock from matplotlib import cbook, dviread as dr from matplotlib.testing import subprocess_run_for_testing, _has_tex_package @@ -147,3 +148,67 @@ def test_dviread_pk(tmp_path): ], }] assert data == correct + + +@pytest.mark.parametrize("readline, write_error, expected", [ + (b"/texmf/pdftex.map\n", None, "/texmf/pdftex.map"), # normal result + (b"nil\n", None, ""), # luatex ok, not found + (b"", None, None), # process died (EOF) + (b"unused", BrokenPipeError, None), # dead pipe on write +]) +def test_luatexkpsewhich_search(readline, write_error, expected): + # None => luatex unusable (triggers fallback); "" => file missing. See #31984. + proc = mock.Mock() + proc.poll.return_value = None # pretend the process is alive (no restart) + proc.stdin.write.side_effect = write_error + proc.stdout.readline.return_value = readline + lk = object.__new__(dr._LuatexKpsewhich) + lk._proc = proc + assert lk.search("pdftex.map") == expected + + +def test_find_tex_file_fallback_to_kpsewhich(monkeypatch): + # A luatex that starts but never returns a usable result (search() -> None) + # must not prevent falling back to kpsewhich. Regression test for #31983. + class _UnusableLuatex: + def search(self, filename): + return None + + monkeypatch.setattr(dr, "_LuatexKpsewhich", _UnusableLuatex) + + commands = [] + + def fake_check_and_log_subprocess(command, logger, **kwargs): + commands.append(command) + return "/texmf/pdftex.map\n" + + monkeypatch.setattr( + cbook, "_check_and_log_subprocess", fake_check_and_log_subprocess) + + dr.find_tex_file.cache_clear() + try: + assert dr.find_tex_file("pdftex.map") == "/texmf/pdftex.map" + finally: + dr.find_tex_file.cache_clear() + assert commands and commands[0][0] == "kpsewhich" + + +def test_find_tex_file_no_fallback_when_luatex_reports_missing(monkeypatch): + # search() -> "" (luatex works, file missing) must not trigger kpsewhich. + class _WorkingLuatex: + def search(self, filename): + return "" + + monkeypatch.setattr(dr, "_LuatexKpsewhich", _WorkingLuatex) + + def fail_if_called(command, logger, **kwargs): + raise AssertionError("kpsewhich should not be called") + + monkeypatch.setattr(cbook, "_check_and_log_subprocess", fail_if_called) + + dr.find_tex_file.cache_clear() + try: + with pytest.raises(FileNotFoundError): + dr.find_tex_file("missing.tfm") + finally: + dr.find_tex_file.cache_clear() From 63f8dca3d9134a90c511860ac4d0f435e7dc87a5 Mon Sep 17 00:00:00 2001 From: kikeenator <296241541+kikeenator@users.noreply.github.com> Date: Mon, 13 Jul 2026 18:45:21 +0000 Subject: [PATCH 006/210] Expand code comments on the luatex->kpsewhich fallback and its tests Clarify search()'s None/"" return contract in dviread, and document what each test covers, why the search() test is mock-based, and the coupling tradeoff that implies. --- lib/matplotlib/dviread.py | 11 +++-- lib/matplotlib/tests/test_dviread.py | 62 +++++++++++++++++++++------- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index 628e74845ecc..2b1c9ea54736 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -1265,15 +1265,20 @@ def _new_proc(self): **os.environ}) def search(self, filename): - if self._proc.poll() is not None: # Dead, restart it. + # Searches for a file in the latex tree by communicating with a luatex + # instance. Returns: + # - None: luatex is unusable (died, or the pipe broke); + # - "": luatex is alive and answered, but the file doesn't exist; + # - anything else: the path of the found file + if self._proc.poll() is not None: # luatex instance is dead, restart it. self._proc = self._new_proc() try: self._proc.stdin.write(os.fsencode(filename) + b"\n") self._proc.stdin.flush() out = self._proc.stdout.readline().rstrip() - except OSError: # luatex started but is now unusable. + except OSError: # Pipe broke mid-communication: luatex is unusable. return None - if out == b"": # Empty read: luatex died; unusable. + if out == b"": # Empty read (EOF): luatex died; unusable. return None # "nil" => file missing but luatex works; return "" (not None). return "" if out == b"nil" else os.fsdecode(out) diff --git a/lib/matplotlib/tests/test_dviread.py b/lib/matplotlib/tests/test_dviread.py index 6ddb5916c6da..4686038956fa 100644 --- a/lib/matplotlib/tests/test_dviread.py +++ b/lib/matplotlib/tests/test_dviread.py @@ -150,32 +150,57 @@ def test_dviread_pk(tmp_path): assert data == correct +# About this test: _LuatexKpsewhich.search() communicates with a long-lived `luatex` +# subprocess over pipes and turns whatever comes back into one of three +# outcomes that its caller (find_tex_file) depends on: +# * a path string -> luatex found the file; +# * "" -> luatex works but the file genuinely doesn't exist; +# * None -> luatex is unusable, so the caller must fall back to +# running kpsewhich directly. +# Each parametrized case below feeds search() one scenario and asserts it maps +# to the right outcome. +# +# Notice: We use mock-based testing here for cross-platform compatibility and +# deterministic/standardized testing. This means that testing is quite heavily +# tied to the internals of the tested function. Restructuring or rewriting of +# code might break testing without actually changing the overall behaviour. +# This tradeoff was accepted in #31984. @pytest.mark.parametrize("readline, write_error, expected", [ - (b"/texmf/pdftex.map\n", None, "/texmf/pdftex.map"), # normal result - (b"nil\n", None, ""), # luatex ok, not found - (b"", None, None), # process died (EOF) - (b"unused", BrokenPipeError, None), # dead pipe on write + # (bytes luatex "prints", exception raised on write, expected return) + # Case 1: supply a path with no error; check search() passes it through + (b"/texmf/pdftex.map\n", None, "/texmf/pdftex.map"), + # Case 2: make luatex answer "nil" (file missing); check search() returns "" + (b"nil\n", None, ""), + # Case 3: supply an empty read (luatex died); check search() returns None + (b"", None, None), + # Case 4: raise an error on write (pipe broke); check search() returns None + (b"unused", BrokenPipeError, None), ]) def test_luatexkpsewhich_search(readline, write_error, expected): - # None => luatex unusable (triggers fallback); "" => file missing. See #31984. - proc = mock.Mock() - proc.poll.return_value = None # pretend the process is alive (no restart) - proc.stdin.write.side_effect = write_error - proc.stdout.readline.return_value = readline - lk = object.__new__(dr._LuatexKpsewhich) - lk._proc = proc + proc = mock.Mock() # stand-in for the luatex subprocess + proc.poll.return_value = None # so search() won't mark it dead and restart it + proc.stdin.write.side_effect = write_error # None => write ok; else pipe broke + proc.stdout.readline.return_value = readline # luatex's answer, read by search() + lk = object.__new__(dr._LuatexKpsewhich) # bypass __new__ (spawns a real luatex) + lk._proc = proc # hand search() our fake process instead assert lk.search("pdftex.map") == expected def test_find_tex_file_fallback_to_kpsewhich(monkeypatch): - # A luatex that starts but never returns a usable result (search() -> None) - # must not prevent falling back to kpsewhich. Regression test for #31983. + # Unlike the search() test above, this checks the routing in find_tex_file, + # which takes the result of search() and acts accordingly by either calling + # the fallback (kpsewhich) if the search failed via luatex, or just forwarding + # the results. We therefore replace the whole _LuatexKpsewhich with a stub + # whose search() always returns None (luatex unusable), and check that + # find_tex_file then falls back to kpsewhich. class _UnusableLuatex: def search(self, filename): return None monkeypatch.setattr(dr, "_LuatexKpsewhich", _UnusableLuatex) + # kpsewhich is run via cbook._check_and_log_subprocess; intercept it so no + # real process is spawned, record what was called, and hand back a path. commands = [] def fake_check_and_log_subprocess(command, logger, **kwargs): @@ -185,27 +210,36 @@ def fake_check_and_log_subprocess(command, logger, **kwargs): monkeypatch.setattr( cbook, "_check_and_log_subprocess", fake_check_and_log_subprocess) + # cache_clear() before and after: find_tex_file is lru_cached, so a stale + # entry could hide the behaviour we test / leak our injected fake function + # into other tests. dr.find_tex_file.cache_clear() try: assert dr.find_tex_file("pdftex.map") == "/texmf/pdftex.map" finally: dr.find_tex_file.cache_clear() + # Check if the intercepted command was indeed kpsewhich (fallback was called). assert commands and commands[0][0] == "kpsewhich" def test_find_tex_file_no_fallback_when_luatex_reports_missing(monkeypatch): - # search() -> "" (luatex works, file missing) must not trigger kpsewhich. + # This exactly mirrors the one above. Here, + # search() returns "" (luatex works, file genuinely missing), which must + # explicitly not trigger the kpsewhich fallback. find_tex_file should just + # raise. class _WorkingLuatex: def search(self, filename): return "" monkeypatch.setattr(dr, "_LuatexKpsewhich", _WorkingLuatex) + # Guard: if the fallback wrongly fired, kpsewhich would run and fail loudly. def fail_if_called(command, logger, **kwargs): raise AssertionError("kpsewhich should not be called") monkeypatch.setattr(cbook, "_check_and_log_subprocess", fail_if_called) + # cache_clear() around the call, as above, to isolate this from other tests. dr.find_tex_file.cache_clear() try: with pytest.raises(FileNotFoundError): From 6edcbc53f71e9dfe58d4b601539d6c52ddc8a560 Mon Sep 17 00:00:00 2001 From: James Lin Date: Sat, 18 Jul 2026 11:59:48 -0700 Subject: [PATCH 007/210] Raise NotImplementedError in MovieWriter._args instead of returning it MovieWriter._args() is a placeholder meant to be overridden by concrete subclasses. It used `return NotImplementedError(...)` instead of `raise`, so a MovieWriter subclass that forgot to override it would not fail loudly: _run() calls `command = self._args()`, which would silently bind an exception instance and pass it on as if it were the command-line argument list, producing a confusing downstream error instead of the intended 'args needs to be implemented by subclass' message. Add a regression test. --- lib/matplotlib/animation.py | 2 +- lib/matplotlib/tests/test_animation.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 7146dc28fcc9..00bb47ebec93 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -356,7 +356,7 @@ def grab_frame(self, **savefig_kwargs): def _args(self): """Assemble list of encoder-specific command-line arguments.""" - return NotImplementedError("args needs to be implemented by subclass.") + raise NotImplementedError("args needs to be implemented by subclass.") @classmethod def bin_path(cls): diff --git a/lib/matplotlib/tests/test_animation.py b/lib/matplotlib/tests/test_animation.py index bfddddf6d665..0fef17e6c44b 100644 --- a/lib/matplotlib/tests/test_animation.py +++ b/lib/matplotlib/tests/test_animation.py @@ -135,6 +135,17 @@ def _run(self): assert writer.dpi == fig.dpi +def test_movie_writer_args_not_implemented(): + # MovieWriter._args is a placeholder that subclasses must override; it + # must *raise* NotImplementedError rather than merely returning it, so a + # subclass that forgets to override it fails loudly instead of passing an + # exception instance on as if it were the command-line arguments. + writer = animation.MovieWriter.__new__(animation.MovieWriter) + with pytest.raises(NotImplementedError, + match="args needs to be implemented by subclass"): + writer._args() + + @animation.writers.register('null') class RegisteredNullMovieWriter(NullMovieWriter): From f515d28b1c5925fa48be6f66b1ce9a6e944b9213 Mon Sep 17 00:00:00 2001 From: Aniket Singh Yadav Date: Thu, 23 Jul 2026 10:21:30 +0000 Subject: [PATCH 008/210] TYP: annotate **kwargs in tripcolor overloads --- lib/matplotlib/tri/_tripcolor.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/tri/_tripcolor.pyi b/lib/matplotlib/tri/_tripcolor.pyi index 42acffcdc52e..85102f82dc89 100644 --- a/lib/matplotlib/tri/_tripcolor.pyi +++ b/lib/matplotlib/tri/_tripcolor.pyi @@ -5,7 +5,7 @@ from matplotlib.tri._triangulation import Triangulation from numpy.typing import ArrayLike -from typing import overload, Literal +from typing import Any, Literal, overload @overload def tripcolor( @@ -20,7 +20,7 @@ def tripcolor( vmax: float | None = ..., shading: Literal["flat"] = ..., facecolors: ArrayLike | None = ..., - **kwargs + **kwargs: Any, ) -> PolyCollection: ... @overload def tripcolor( @@ -36,7 +36,7 @@ def tripcolor( vmax: float | None = ..., shading: Literal["flat"] = ..., facecolors: ArrayLike | None = ..., - **kwargs + **kwargs: Any, ) -> PolyCollection: ... @overload def tripcolor( @@ -51,7 +51,7 @@ def tripcolor( vmax: float | None = ..., shading: Literal["gouraud"], facecolors: ArrayLike | None = ..., - **kwargs + **kwargs: Any, ) -> TriMesh: ... @overload def tripcolor( @@ -67,5 +67,5 @@ def tripcolor( vmax: float | None = ..., shading: Literal["gouraud"], facecolors: ArrayLike | None = ..., - **kwargs + **kwargs: Any, ) -> TriMesh: ... From 5469b432e0144acde96ef032858607c3b3c7f81a Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Fri, 7 Aug 2026 21:19:22 -0700 Subject: [PATCH 009/210] Un-reverse mouse buttons on macOS --- lib/matplotlib/backends/_backend_tk.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/matplotlib/backends/_backend_tk.py b/lib/matplotlib/backends/_backend_tk.py index 97edbfa8bd06..0217ef55baaf 100644 --- a/lib/matplotlib/backends/_backend_tk.py +++ b/lib/matplotlib/backends/_backend_tk.py @@ -356,8 +356,6 @@ def button_press_event(self, event, dblclick=False): self._tkcanvas.focus_set() num = getattr(event, 'num', None) - if sys.platform == 'darwin': # 2 and 3 are reversed. - num = {2: 3, 3: 2}.get(num, num) MouseEvent("button_press_event", self, *self._event_mpl_coords(event), num, dblclick=dblclick, modifiers=self._mpl_modifiers(event), @@ -368,8 +366,6 @@ def button_dblclick_event(self, event): def button_release_event(self, event): num = getattr(event, 'num', None) - if sys.platform == 'darwin': # 2 and 3 are reversed. - num = {2: 3, 3: 2}.get(num, num) MouseEvent("button_release_event", self, *self._event_mpl_coords(event), num, modifiers=self._mpl_modifiers(event), @@ -402,14 +398,6 @@ def _mpl_buttons(event): # See _mpl_modifiers. # NOTE: This fails to report multiclicks on macOS; only one button is # reported (multiclicks work correctly on Linux & Windows). modifiers = [ - # macOS appears to swap right and middle (look for "Swap buttons - # 2/3" in tk/macosx/tkMacOSXMouseEvent.c). - (MouseButton.LEFT, 1 << 8), - (MouseButton.RIGHT, 1 << 9), - (MouseButton.MIDDLE, 1 << 10), - (MouseButton.BACK, 1 << 11), - (MouseButton.FORWARD, 1 << 12), - ] if sys.platform == "darwin" else [ (MouseButton.LEFT, 1 << 8), (MouseButton.MIDDLE, 1 << 9), (MouseButton.RIGHT, 1 << 10), From 685fd7b8250acfed07d325414798fc665ebcdeb7 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 12 Jun 2026 01:33:38 -0400 Subject: [PATCH 010/210] macOS: Check for display availability when looking for backends --- lib/matplotlib/tests/test_backend_macosx.py | 7 +++++++ lib/matplotlib/tests/test_backend_qt.py | 5 ++--- lib/matplotlib/tests/test_backend_tk.py | 4 ++-- lib/matplotlib/tests/test_backends_interactive.py | 9 ++++++--- lib/matplotlib/tests/test_rcparams.py | 4 +--- src/_c_internal_utils.cpp | 13 +++++++++++++ src/meson.build | 6 +++--- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_macosx.py b/lib/matplotlib/tests/test_backend_macosx.py index 0648e43cde94..9e0519fe663a 100644 --- a/lib/matplotlib/tests/test_backend_macosx.py +++ b/lib/matplotlib/tests/test_backend_macosx.py @@ -6,10 +6,17 @@ from unittest import mock import matplotlib as mpl +from matplotlib import _c_internal_utils import matplotlib.pyplot as plt from matplotlib.testing import subprocess_run_helper +pytestmark = [ + pytest.mark.skipif(not _c_internal_utils.display_is_valid(), + reason="Display is unavailable") +] + + _test_timeout = 60 diff --git a/lib/matplotlib/tests/test_backend_qt.py b/lib/matplotlib/tests/test_backend_qt.py index ae24effe505f..ce694e8059ff 100644 --- a/lib/matplotlib/tests/test_backend_qt.py +++ b/lib/matplotlib/tests/test_backend_qt.py @@ -310,9 +310,8 @@ def _get_testable_qt_backends(): ]: reason = None missing = [dep for dep in deps if not importlib.util.find_spec(dep)] - if (sys.platform == "linux" and - not _c_internal_utils.display_is_valid()): - reason = "$DISPLAY and $WAYLAND_DISPLAY are unset" + if not _c_internal_utils.display_is_valid(): + reason = "Display is unavailable" elif missing: reason = "{} cannot be imported".format(", ".join(missing)) elif env["MPLBACKEND"] == 'macosx' and os.environ.get('TF_BUILD'): diff --git a/lib/matplotlib/tests/test_backend_tk.py b/lib/matplotlib/tests/test_backend_tk.py index 839d299f3d48..aac817f3264b 100644 --- a/lib/matplotlib/tests/test_backend_tk.py +++ b/lib/matplotlib/tests/test_backend_tk.py @@ -36,8 +36,8 @@ def _isolated_tk_test(success_count, func=None): reason="missing tkinter" ) @pytest.mark.skipif( - sys.platform == "linux" and not _c_internal_utils.xdisplay_is_valid(), - reason="$DISPLAY is unset" + not _c_internal_utils.display_is_valid(), + reason="Display is unavailable" ) @functools.wraps(func) def test_func(): diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 2e2713f15ee1..d146f9e55c3a 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -59,6 +59,8 @@ def _get_available_interactive_backends(): not _c_internal_utils.display_is_valid()) _is_linux_and_xdisplay_invalid = (sys.platform == "linux" and not _c_internal_utils.xdisplay_is_valid()) + _is_macos_and_display_invalid = (sys.platform == "darwin" and + not _c_internal_utils.display_is_valid()) envs = [] for deps, env in [ *[([qt_api], @@ -85,6 +87,8 @@ def _get_available_interactive_backends(): reason = "$DISPLAY is unset" elif _is_linux_and_display_invalid: reason = "$DISPLAY and $WAYLAND_DISPLAY are unset" + elif _is_macos_and_display_invalid: + reason = "Display is unavailable" elif env["MPLBACKEND"] == 'macosx' and os.environ.get('TF_BUILD'): reason = "macosx backend fails on Azure" elif env["MPLBACKEND"].startswith('gtk'): @@ -451,9 +455,8 @@ def qt5_and_qt6_pairs(): yield from ([qt5, qt6], [qt6, qt5]) -@pytest.mark.skipif( - sys.platform == "linux" and not _c_internal_utils.display_is_valid(), - reason="$DISPLAY and $WAYLAND_DISPLAY are unset") +@pytest.mark.skipif(not _c_internal_utils.display_is_valid(), + reason='Display is unavailable') @pytest.mark.parametrize('host, mpl', [*qt5_and_qt6_pairs()]) def test_cross_Qt_imports(host, mpl): try: diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py index fb1b2730e93e..73ace5c88069 100644 --- a/lib/matplotlib/tests/test_rcparams.py +++ b/lib/matplotlib/tests/test_rcparams.py @@ -573,9 +573,7 @@ def test_backend_fallback_headless_auto_backend(tmp_path): assert backend.strip().lower() == "agg" -@pytest.mark.skipif( - sys.platform == "linux" and not _c_internal_utils.xdisplay_is_valid(), - reason="headless") +@pytest.mark.skipif(not _c_internal_utils.display_is_valid(), reason="headless") def test_backend_fallback_headful(tmp_path): if parse_version(pytest.__version__) >= parse_version('8.2.0'): pytest_kwargs = dict(exc_type=ImportError) diff --git a/src/_c_internal_utils.cpp b/src/_c_internal_utils.cpp index ff9dc4fcc52b..b19b7419d079 100644 --- a/src/_c_internal_utils.cpp +++ b/src/_c_internal_utils.cpp @@ -31,6 +31,7 @@ #ifdef __APPLE__ #include #include +#include #endif namespace py = pybind11; @@ -94,6 +95,16 @@ mpl_display_is_valid(void) } } return false; +#elif defined(__APPLE__) + CFDictionaryRef session_info; + + session_info = CGSessionCopyCurrentDictionary(); + if (session_info == NULL) { + return false; + } + + CFRelease(session_info); + return true; #else return true; #endif @@ -258,6 +269,8 @@ PYBIND11_MODULE(_c_internal_utils, m, py::mod_gil_not_used()) succeeds, or $WAYLAND_DISPLAY is set and wl_display_connect(NULL) succeeds. + On macOS, returns True if CGSessionCopyCurrentDictionary is not NULL. + On other platforms, always returns True.)"""); m.def( "xdisplay_is_valid", &mpl_xdisplay_is_valid, diff --git a/src/meson.build b/src/meson.build index 077b7f0353b6..d44036c479d0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -31,9 +31,9 @@ else endif if host_machine.system() == 'darwin' - coretext = dependency('appleframeworks', modules: 'CoreText') + appleframeworks = dependency('appleframeworks', modules: ['CoreGraphics', 'CoreText']) else - coretext = [] + appleframeworks = [] endif extension_data = { @@ -50,7 +50,7 @@ extension_data = { 'sources': files( '_c_internal_utils.cpp', ), - 'dependencies': [pybind11_dep, dl, ole32, shell32, user32, coretext], + 'dependencies': [pybind11_dep, dl, ole32, shell32, user32, appleframeworks], }, 'ft2font': { 'subdir': 'matplotlib', From 153449ebd6da6601bb5062c30a708743c5d565de Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 31 Aug 2026 07:47:30 -0400 Subject: [PATCH 011/210] Add set_data for ContourSet --- .../next_whats_new/contourset_set_data.rst | 12 +++ galleries/examples/animation/simple_anim.py | 29 +++++ lib/matplotlib/cbook.py | 20 ++++ lib/matplotlib/cbook.pyi | 3 + lib/matplotlib/contour.py | 73 ++++++++++++- lib/matplotlib/contour.pyi | 1 + lib/matplotlib/tests/test_contour.py | 101 +++++++++++++++++- 7 files changed, 235 insertions(+), 4 deletions(-) create mode 100644 doc/release/next_whats_new/contourset_set_data.rst diff --git a/doc/release/next_whats_new/contourset_set_data.rst b/doc/release/next_whats_new/contourset_set_data.rst new file mode 100644 index 000000000000..bd6d3b56a1f4 --- /dev/null +++ b/doc/release/next_whats_new/contourset_set_data.rst @@ -0,0 +1,12 @@ +Contour sets can be updated with new data +----------------------------------------- +`.ContourSet.set_data` recontours new data using the existing artist, instead of +requiring the contour set to be removed and recreated:: + + cs = ax.contour(X, Y, Z) + cs.set_data(X, Y, Z2) + +It works for `~.Axes.contour`, `~.Axes.contourf`, `~.Axes.tricontour` and +`~.Axes.tricontourf`. The contour levels are kept, so the colors, the colorbar +and the legend entries of the contour set remain valid. This is useful for +animations and other interactive updates. diff --git a/galleries/examples/animation/simple_anim.py b/galleries/examples/animation/simple_anim.py index 2b65b5935b40..c1c37527ee5d 100644 --- a/galleries/examples/animation/simple_anim.py +++ b/galleries/examples/animation/simple_anim.py @@ -37,6 +37,35 @@ def animate(i): plt.show() +# %% +# Contours are updated the same way, with `.ContourSet.set_data`. Recontouring +# the existing artist is faster than removing the contour set and making a new +# one, and it keeps the contours in the same place in the draw order, which +# matters when blitting. The levels are not recomputed, so the colors mean +# the same thing in every frame. + +fig, ax = plt.subplots() + +X, Y = np.meshgrid(np.linspace(-3, 3, 100), np.linspace(-3, 3, 100)) + + +def f(t): + return np.sin(X + t) * np.cos(Y - t) + + +cs = ax.contour(X, Y, f(0), levels=np.linspace(-0.9, 0.9, 7)) + + +def animate_contour(i): + cs.set_data(X, Y, f(i / 25)) # update the data. + return cs, + + +ani_contour = animation.FuncAnimation( + fig, animate_contour, interval=20, blit=True, save_count=50) + +plt.show() + # %% # # .. tags:: diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 7aaf900d4e61..9c05273bdb35 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -2175,6 +2175,26 @@ def _setattr_cm(obj, **kwargs): setattr(obj, attr, orig) +# TODO: Could be used in Line2D.set_data and other setters that mutate an artist +# more than once, and so can leave it half-updated when they raise. +@contextlib.contextmanager +def _safe_state_update(obj): + """ + Context manager to make an in-place update of *obj* all-or-nothing. + + Yields a snapshot of ``obj.__dict__``, which is restored if the body raises, so + that an update mutating *obj* incrementally -- and able to fail partway through + -- leaves it as it was rather than half-updated. + """ + state = obj.__dict__.copy() + try: + yield state + except Exception: + obj.__dict__.clear() + obj.__dict__.update(state) + raise + + class _OrderedSet(collections.abc.MutableSet): def __init__(self): self._od = collections.OrderedDict() diff --git a/lib/matplotlib/cbook.pyi b/lib/matplotlib/cbook.pyi index 653e2219c5b7..5769107f4b60 100644 --- a/lib/matplotlib/cbook.pyi +++ b/lib/matplotlib/cbook.pyi @@ -158,6 +158,9 @@ def _array_perimeter(arr: np.ndarray) -> np.ndarray: ... def _unfold(arr: np.ndarray, axis: int, size: int, step: int) -> np.ndarray: ... def _array_patch_perimeters(x: np.ndarray, rstride: int, cstride: int) -> np.ndarray: ... def _setattr_cm(obj: Any, **kwargs) -> contextlib.AbstractContextManager[None]: ... +def _safe_state_update( + obj: Any, +) -> contextlib.AbstractContextManager[dict[str, Any]]: ... class _OrderedSet(collections.abc.MutableSet): def __init__(self) -> None: ... diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 26a25c00dc09..3656d2a97687 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -891,6 +891,66 @@ def legend_elements(self, variable_name='x', str_format=str): return artists, labels + def set_data(self, *args, **kwargs): + """ + Set new data and recompute the contours. + + Call signatures:: + + set_data(Z) + set_data(X, Y, Z) + + This reuses the existing artist, which is faster than removing the + contour set and creating a new one, and keeps its styling and its + place in the draw tree. + + .. versionadded:: 3.12 + + Parameters + ---------- + *args + The new data, interpreted as by the function that created this + contour set, i.e. `~.Axes.contour`, `~.Axes.contourf`, + `~.Axes.tricontour` or `~.Axes.tricontourf`. + + **kwargs + Only the keywords of that function that control *how the contours are + computed* are accepted, and they keep their current values if not + given: *corner_mask*, *algorithm* and the *xunits*/*yunits* unit + keywords for `~.Axes.contour`. Keywords that control how the contours + *look* (*levels*, *colors*, *cmap*, *linewidths*, ...) raise + `TypeError`; set those with the corresponding `.Collection` setters, or + create a new contour set. + + Notes + ----- + The *levels* are not recomputed; the new data is contoured at the + levels already in use, so that the colors and the colorbar stay + valid. Create a new contour set if you need different levels. + + Existing contour labels are not moved. The Axes limits are not + rescaled, as for other artists' data setters. + """ + # _process_args() both validates and mutates: by the time it can fail it has + # already rebound the levels, zmin/zmax and the contour generator, so a + # rejected call would otherwise leave the contour set half-updated. + with cbook._safe_state_update(self) as state: + kwargs = self._process_args(*args, **kwargs) + if kwargs: + raise TypeError( + f"set_data() got unexpected keyword arguments {[*kwargs]}") + if not np.array_equal(state['levels'], self.levels): + # Only reachable through the ContourSet(ax, levels, allsegs) + # signature. Keeping the levels fixed is what lets us skip + # reprocessing the layers and the colors here, so enforce it rather + # than silently mismatching them. + raise ValueError("set_data() cannot change the contour levels") + if self._paths is state['_paths']: # Not set by _process_args. + self._paths = self._make_paths_from_contour_generator() + self.sticky_edges.x[:] = [self._mins[0], self._maxs[0]] + self.sticky_edges.y[:] = [self._mins[1], self._maxs[1]] + self.stale = True + def _process_args(self, *args, **kwargs): """ Process *args* and *kwargs*; override in derived classes. @@ -937,8 +997,6 @@ def _process_args(self, *args, **kwargs): def _make_paths_from_contour_generator(self): """Compute ``paths`` using C extension.""" - if self._paths is not None: - return self._paths cg = self._contour_generator empty_path = Path(np.empty((0, 2))) vertices_and_codes = ( @@ -1315,6 +1373,11 @@ class QuadContourSet(ContourSet): %(contour_set_attributes)s """ + # Set on the first _process_args; a later call from set_data keeps these rather + # than falling back to the rcParams. + _algorithm = None + _corner_mask = None + def _process_args(self, *args, corner_mask=None, algorithm=None, **kwargs): """ Process args and kwargs. @@ -1332,10 +1395,13 @@ def _process_args(self, *args, corner_mask=None, algorithm=None, **kwargs): else: import contourpy - algorithm = mpl._val_or_rc(algorithm, 'contour.algorithm') + algorithm = mpl._val_or_rc( + algorithm or self._algorithm, 'contour.algorithm') mpl.rcParams.validate["contour.algorithm"](algorithm) self._algorithm = algorithm + if corner_mask is None: + corner_mask = self._corner_mask if corner_mask is None: if self._algorithm == "mpl2005": # mpl2005 does not support corner_mask=True so if not @@ -1530,6 +1596,7 @@ def _initialize_x_y(self, z): Returns ------- `~.contour.QuadContourSet` + Use `.ContourSet.set_data` to recontour new data with the same artist. Other Parameters ---------------- diff --git a/lib/matplotlib/contour.pyi b/lib/matplotlib/contour.pyi index 26b3a43c75ab..aac26b1e8d04 100644 --- a/lib/matplotlib/contour.pyi +++ b/lib/matplotlib/contour.pyi @@ -131,6 +131,7 @@ class ContourSet(ContourLabeler, Collection): def legend_elements( self, variable_name: str = ..., str_format: Callable[[float], str] = ... ) -> tuple[list[Artist], list[str]]: ... + def set_data(self, *args, **kwargs) -> None: ... def find_nearest_contour( self, x: float, y: float, indices: Iterable[int] | None = ..., pixel: bool = ... ) -> tuple[int, int, int, float, float, float]: ... diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py index 8b13caa15e67..094c2bdc7978 100644 --- a/lib/matplotlib/tests/test_contour.py +++ b/lib/matplotlib/tests/test_contour.py @@ -5,7 +5,9 @@ import contourpy import numpy as np -from numpy.testing import assert_array_almost_equal, assert_array_almost_equal_nulp +from numpy.testing import ( + assert_array_almost_equal, assert_array_almost_equal_nulp, + assert_array_equal) import matplotlib as mpl from matplotlib import pyplot as plt, rc_context, ticker from matplotlib.colors import LogNorm, same_color @@ -896,3 +898,100 @@ def test_clabel_manual_subset(): cs = ax.contour([[1, 2], [3, 4]], levels=[1.5, 2.5, 3.5]) # Attempt to label only one specific level manually ax.clabel(cs, levels=[2.5], manual=[(0.5, 0.5)]) + + +@pytest.mark.parametrize("levels", [None, [-0.5, 0, 0.5]]) +@pytest.mark.parametrize("plotter", ["contour", "contourf"]) +@check_figures_equal() +def test_contour_set_data(fig_test, fig_ref, plotter, levels): + x, y = np.meshgrid(np.linspace(-3, 3, 20), np.linspace(-3, 3, 20)) + z1 = np.sin(x) * np.cos(y) + z2 = np.cos(x) * np.sin(y) + + cs = getattr(fig_test.subplots(), plotter)(x, y, z1, levels=levels) + orig_levels = cs.levels.copy() + cs.set_data(x, y, z2) + # The levels are kept, also where they were autoscaled from the old data. + assert_array_equal(cs.levels, orig_levels) + getattr(fig_ref.subplots(), plotter)(x, y, z2, levels=orig_levels) + + +@check_figures_equal() +def test_contour_set_data_z_only(fig_test, fig_ref): + z1 = np.arange(25).reshape((5, 5)) % 7 + z2 = np.arange(25).reshape((5, 5)) % 5 + fig_test.subplots().contour(z1, levels=[1, 2, 3]).set_data(z2) + fig_ref.subplots().contour(z2, levels=[1, 2, 3]) + + +def test_contour_set_data_updates_artist_state(): + x, y = np.meshgrid(np.linspace(0, 1, 5), np.linspace(0, 1, 5)) + fig = plt.figure() + cs = fig.add_subplot().contour(x, y, x + y, levels=[0.5, 1, 1.5]) + fig.canvas.draw() + assert not cs.stale + cs.set_data(2 * x - 1, 2 * y - 1, x + y) + assert cs.stale + assert cs.sticky_edges.x == [-1, 1] + assert cs.sticky_edges.y == [-1, 1] + + +def test_contour_set_data_changing_levels(): + # The (levels, allsegs) signature is the only way set_data could change the + # levels, which would leave the colors and the colorbar mismatched. + segs = [[np.array([[0.0, 0.0], [1.0, 1.0]])]] + cs = mpl.contour.ContourSet(plt.figure().add_subplot(), [0.5], segs) + cs.set_data([0.5], segs) # Same levels, new segments: fine. + with pytest.raises(ValueError, match="cannot change the contour levels"): + cs.set_data([0.25, 0.75], segs * 2) + assert_array_equal(cs.levels, [0.5]) # Rolled back, not half-applied. + + +def test_contour_set_data_keeps_algorithm_and_corner_mask(): + z = np.array([[1.0, 2.0], [3.0, 4.0]]) + cs = plt.figure().add_subplot().contour( + z, algorithm='mpl2005', corner_mask=False) + cs.set_data(z * 2) + assert cs._algorithm == 'mpl2005' + assert cs._corner_mask is False + # They describe how the contours are computed, so they can also be re-set. + cs.set_data(z * 2, algorithm='serial', corner_mask=True) + assert cs._algorithm == 'serial' + assert cs._corner_mask is True + + +def _assert_set_data_rejects(exc, match, args=(), **kwargs): + # A rejected set_data() must raise and leave the contour set exactly as it was, + # rather than with the levels or the contour generator already swapped out. + z = np.arange(9).reshape((3, 3)) + fig = plt.figure() + cs = fig.add_subplot().contour(z) + before = (cs.levels.copy(), [p.vertices.copy() for p in cs.get_paths()], + cs.zmin, cs.zmax, cs._contour_generator) + with pytest.raises(exc, match=match): + cs.set_data(*(args or (z,)), **kwargs) + assert_array_equal(cs.levels, before[0]) + for path, vertices in zip(cs.get_paths(), before[1], strict=True): + assert_array_equal(path.vertices, vertices) + assert (cs.zmin, cs.zmax, cs._contour_generator) == before[2:] + fig.canvas.draw() # Must not raise. + + +@pytest.mark.parametrize("kwargs", [ + {"levels": [1, 2]}, {"colors": "red"}, {"cmap": "plasma"}, + {"linewidths": 2}, {"linestyles": "dashed"}, {"extend": "both"}, + {"alpha": 0.5}, {"hatches": ["/"]}, {"zorder": 5}, +]) +def test_contour_set_data_rejects_style_kwargs(kwargs): + # Only the keywords that feed the contour generator are accepted; anything + # affecting the appearance would leave the levels and the colors mismatched. + _assert_set_data_rejects(TypeError, "unexpected keyword arguments", **kwargs) + + +@pytest.mark.parametrize("args", [ + (np.arange(5), np.arange(5), np.empty((3, 4))), # mismatched shapes + (np.arange(7),), # z is not 2D + (np.empty((3, 3)),) * 5, # too many arguments +]) +def test_contour_set_data_rejects_bad_data(args): + _assert_set_data_rejects((TypeError, ValueError), None, args) From dd16a6753ce250b4095a4a792deb42cc7338dab1 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 31 Aug 2026 08:18:06 -0400 Subject: [PATCH 012/210] Fix bug with tricontour triangles --- lib/matplotlib/contour.py | 9 +++---- lib/matplotlib/tests/test_triangulation.py | 28 ++++++++++++++++++++++ lib/matplotlib/tri/_tricontour.py | 6 +++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 3656d2a97687..e6ace0b6b3aa 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -917,10 +917,11 @@ def set_data(self, *args, **kwargs): Only the keywords of that function that control *how the contours are computed* are accepted, and they keep their current values if not given: *corner_mask*, *algorithm* and the *xunits*/*yunits* unit - keywords for `~.Axes.contour`. Keywords that control how the contours - *look* (*levels*, *colors*, *cmap*, *linewidths*, ...) raise - `TypeError`; set those with the corresponding `.Collection` setters, or - create a new contour set. + keywords for `~.Axes.contour`, or *triangles* and *mask* for + `~.Axes.tricontour`. Keywords that control how the contours *look* + (*levels*, *colors*, *cmap*, *linewidths*, ...) raise `TypeError`; set + those with the corresponding `.Collection` setters, or create a new + contour set. Notes ----- diff --git a/lib/matplotlib/tests/test_triangulation.py b/lib/matplotlib/tests/test_triangulation.py index 0293423e06b0..db04dae680e7 100644 --- a/lib/matplotlib/tests/test_triangulation.py +++ b/lib/matplotlib/tests/test_triangulation.py @@ -1323,6 +1323,34 @@ def test_tricontourset_reuse(): assert tcs3._contour_generator == tcs1._contour_generator +@pytest.mark.parametrize("plotter", ["tricontour", "tricontourf"]) +@check_figures_equal() +def test_tricontour_triangles_kwarg(fig_test, fig_ref, plotter): + # Passing triangles by keyword used to fall through to Collection.set(). + x = [0.0, 1.0, 2.0, 0.0, 1.0, 0.0] + y = [0.0, 0.0, 0.0, 1.0, 1.0, 2.0] + z = [0.0, 1.0, 2.0, 1.0, 2.0, 3.0] + triangles = [[0, 1, 3], [1, 4, 3], [1, 2, 4], [3, 4, 5]] + levels = [0.5, 1.5, 2.5] + getattr(fig_test.subplots(), plotter)(x, y, z, triangles=triangles, + levels=levels) + getattr(fig_ref.subplots(), plotter)(x, y, triangles, z, levels=levels) + + +@check_figures_equal() +def test_tricontour_set_data(fig_test, fig_ref): + x = [0.0, 0.5, 1.0, 0.0, 0.5, 0.0] + y = [0.0, 0.0, 0.0, 0.5, 0.5, 1.0] + z1 = [0.0, 1.0, 2.0, 1.0, 2.0, 3.0] + z2 = [3.0, 2.0, 1.0, 2.0, 1.0, 0.0] + levels = [0.5, 1.5, 2.5] + triangles = [[0, 1, 3], [1, 4, 3], [1, 2, 4], [3, 4, 5]] + cs = fig_test.subplots().tricontour(x, y, z1, triangles=triangles, + levels=levels) + cs.set_data(x, y, z2, triangles=triangles) + fig_ref.subplots().tricontour(x, y, z2, triangles=triangles, levels=levels) + + @check_figures_equal() def test_triplot_with_ls(fig_test, fig_ref): x = [0, 2, 1] diff --git a/lib/matplotlib/tri/_tricontour.py b/lib/matplotlib/tri/_tricontour.py index 8250515f3ef8..54767da8783c 100644 --- a/lib/matplotlib/tri/_tricontour.py +++ b/lib/matplotlib/tri/_tricontour.py @@ -42,7 +42,7 @@ def _process_args(self, *args, **kwargs): self._maxs = args[0]._maxs else: from matplotlib import _tri - tri, z = self._contour_args(args, kwargs) + tri, z, kwargs = self._contour_args(args, kwargs) C = _tri.TriContourGenerator(tri.get_cpp_triangulation(), z) self._mins = [tri.x.min(), tri.y.min()] self._maxs = [tri.x.max(), tri.y.max()] @@ -76,7 +76,9 @@ def _contour_args(self, args, kwargs): func = 'contourf' if self.filled else 'contour' raise ValueError(f'Cannot {func} log of negative values.') self._process_contour_level_args(args, z.dtype) - return (tri, z) + # Return kwargs with the triangulation parameters removed; the caller must + # not see e.g. *triangles* again, or it ends up in Collection.set(). + return (tri, z, kwargs) _docstring.interpd.register(_tricontour_doc=""" From e7e4db15f7d42606940f9122fa9621d859759071 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 13 Nov 2024 03:57:54 -0500 Subject: [PATCH 013/210] Port GTK4 backend to GtkSnapshot GTK 4.14 adds enough path API that we can fully avoid Cairo, so it makes more sense to move to the new API now. This means we can drop Cairo, and also not do any processing ourselves to change formats. The texture is likely cached on the GPU, so we cache the object on the canvas until re-drawing occurs. On older versions, we fall back to a version using Cairo, but this is only required for the zoom rectangle. Also fix some deprecations in the GTK4 examples. --- lib/matplotlib/backends/_backend_gtk.py | 6 -- lib/matplotlib/backends/backend_gtk3.py | 10 +- lib/matplotlib/backends/backend_gtk3agg.py | 2 +- lib/matplotlib/backends/backend_gtk4.py | 107 ++++++++++++------- lib/matplotlib/backends/backend_gtk4agg.py | 38 +++---- lib/matplotlib/backends/backend_gtk4cairo.py | 13 ++- 6 files changed, 96 insertions(+), 80 deletions(-) diff --git a/lib/matplotlib/backends/_backend_gtk.py b/lib/matplotlib/backends/_backend_gtk.py index a0178eecf5b9..c253a43c6032 100644 --- a/lib/matplotlib/backends/_backend_gtk.py +++ b/lib/matplotlib/backends/_backend_gtk.py @@ -13,17 +13,11 @@ TimerBase) from matplotlib.backend_tools import Cursors -import gi # The GTK3/GTK4 backends will have already called `gi.require_version` to set # the desired GTK. from gi.repository import Gdk, Gio, GLib, Gtk, GdkPixbuf -try: - gi.require_foreign("cairo") -except ImportError as e: - raise ImportError("Gtk-based backends require cairo") from e - _log = logging.getLogger(__name__) _application = None # Placeholder diff --git a/lib/matplotlib/backends/backend_gtk3.py b/lib/matplotlib/backends/backend_gtk3.py index 0cb54b31eab7..3c8c4781d32f 100644 --- a/lib/matplotlib/backends/backend_gtk3.py +++ b/lib/matplotlib/backends/backend_gtk3.py @@ -10,7 +10,10 @@ CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent) try: - from gi import require_version as gi_require_version + from gi import ( + require_version as gi_require_version, + require_foreign as gi_require_foreign, + ) except ImportError as err: raise ImportError("The GTK3 backends require PyGObject") from err @@ -24,6 +27,11 @@ # auto-backend selection logic correctly skips. raise ImportError(e) from e +try: + gi_require_foreign("cairo") +except ImportError as e: + raise ImportError("GTK3-based backends require cairo") from e + from gi.repository import Gio, GLib, GObject, Gtk, Gdk from . import _backend_gtk from ._backend_gtk import ( # noqa: F401 # pylint: disable=W0611 diff --git a/lib/matplotlib/backends/backend_gtk3agg.py b/lib/matplotlib/backends/backend_gtk3agg.py index bb469b85783d..c48d0f61c5cb 100644 --- a/lib/matplotlib/backends/backend_gtk3agg.py +++ b/lib/matplotlib/backends/backend_gtk3agg.py @@ -4,7 +4,7 @@ from . import backend_agg, backend_gtk3 from .backend_gtk3 import GLib, Gtk, _BackendGTK3 -import cairo # Presence of cairo is already checked by _backend_gtk. +import cairo # Presence of cairo is already checked by backend_gtk3. class FigureCanvasGTK3Agg(backend_agg.FigureCanvasAgg, diff --git a/lib/matplotlib/backends/backend_gtk4.py b/lib/matplotlib/backends/backend_gtk4.py index 05594a76d5a2..f483c7cdbd94 100644 --- a/lib/matplotlib/backends/backend_gtk4.py +++ b/lib/matplotlib/backends/backend_gtk4.py @@ -19,24 +19,36 @@ gi_require_version("Gtk", "4.0") gi_require_version("Gdk", "4.0") gi_require_version("GdkPixbuf", "2.0") + gi_require_version("Graphene", "1.0") except ValueError as e: # in this case we want to re-raise as ImportError so the # auto-backend selection logic correctly skips. raise ImportError(e) from e import gi -from gi.repository import Gio, GLib, Gtk, Gdk, GdkPixbuf +from gi.repository import GLib, Gio, Gdk, GdkPixbuf, Graphene, Gtk from . import _backend_gtk from ._backend_gtk import ( # noqa: F401 # pylint: disable=W0611 _BackendGTK, _FigureCanvasGTK, _FigureManagerGTK, _NavigationToolbar2GTK, TimerGTK as TimerGTK4, ) +# For GTK 4.14, there is enough path implementation to use the snapshot for the zoom +# tool, and then we don't need Cairo. +_USE_SNAPSHOT_ZOOM = Gtk.check_version(4, 14, 0) is None +if _USE_SNAPSHOT_ZOOM: + from gi.repository import Gsk +else: + try: + gi.require_foreign("cairo") + except ImportError as e: + raise ImportError("Gtk-based backends require cairo") from e + _GOBJECT_GE_3_47 = gi.version_info >= (3, 47, 0) _GTK_GE_4_12 = Gtk.check_version(4, 12, 0) is None -class FigureCanvasGTK4(_FigureCanvasGTK, Gtk.DrawingArea): +class FigureCanvasGTK4(_FigureCanvasGTK, Gtk.Widget): required_interactive_framework = "gtk4" supports_blit = False manager_class = _api.classproperty(lambda cls: FigureManagerGTK4) @@ -50,8 +62,6 @@ def __init__(self, figure=None): self._idle_draw_id = 0 self._rubberband_rect = None - self.set_draw_func(self._draw_func) - self.connect('resize', self.resize_event) if _GTK_GE_4_12: self.connect('realize', self._realize_event) else: @@ -81,16 +91,6 @@ def __init__(self, figure=None): self.set_focusable(True) - css = Gtk.CssProvider() - style = '.matplotlib-canvas { background-color: white; }' - if Gtk.check_version(4, 9, 3) is None: - css.load_from_data(style, -1) - else: - css.load_from_data(style.encode('utf-8')) - style_ctx = self.get_style_context() - style_ctx.add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) - style_ctx.add_class("matplotlib-canvas") - def destroy(self): CloseEvent("close_event", self)._process() @@ -183,7 +183,7 @@ def leave_notify_event(self, controller): guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None, )._process() - def resize_event(self, area, width, height): + def do_size_allocate(self, width, height, baseline): self._update_device_pixel_ratio() dpi = self.figure.dpi winch = width * self.device_pixel_ratio / dpi @@ -265,11 +265,15 @@ def _draw_rubberband(self, rect): # TODO: Only update the rubberband area. self.queue_draw() - def _draw_func(self, drawing_area, ctx, width, height): - self.on_draw_event(self, ctx) - self._post_draw(self, ctx) + def do_snapshot(self, snapshot): + white = Gdk.RGBA() + white.red = white.green = white.blue = white.alpha = 1.0 + rect = Graphene.Rect().init(0, 0, self.get_width(), self.get_height()) + snapshot.append_color(white, rect) + self.on_snapshot_event(snapshot) + self._post_snapshot(snapshot) - def _post_draw(self, widget, ctx): + def _post_snapshot(self, snapshot): if self._rubberband_rect is None: return @@ -280,28 +284,49 @@ def _post_draw(self, widget, ctx): x1 = x0 + w y1 = y0 + h - # Draw the lines from x0, y0 towards x1, y1 so that the - # dashes don't "jump" when moving the zoom box. - ctx.move_to(x0, y0) - ctx.line_to(x0, y1) - ctx.move_to(x0, y0) - ctx.line_to(x1, y0) - ctx.move_to(x0, y1) - ctx.line_to(x1, y1) - ctx.move_to(x1, y0) - ctx.line_to(x1, y1) - - ctx.set_antialias(1) - ctx.set_line_width(lw) - ctx.set_dash((dash, dash), 0) - ctx.set_source_rgb(0, 0, 0) - ctx.stroke_preserve() - - ctx.set_dash((dash, dash), dash) - ctx.set_source_rgb(1, 1, 1) - ctx.stroke() - - def on_draw_event(self, widget, ctx): + def make_path(builder): + # Draw the lines from x0, y0 towards x1, y1 so that the dashes don't "jump" + # when moving the zoom box. + builder.move_to(x0, y0) + builder.line_to(x0, y1) + builder.move_to(x0, y0) + builder.line_to(x1, y0) + builder.move_to(x0, y1) + builder.line_to(x1, y1) + builder.move_to(x1, y0) + builder.line_to(x1, y1) + + if _USE_SNAPSHOT_ZOOM: + pb = Gsk.PathBuilder() + make_path(pb) + path = pb.to_path() + + stroke = Gsk.Stroke(line_width=lw) + stroke.set_dash((dash, dash)) + colour = Gdk.RGBA() + colour.alpha = 1.0 + colour.red = colour.green = colour.blue = 0.0 + snapshot.append_stroke(path, stroke, colour) + + stroke.set_dash_offset(dash) + colour.red = colour.green = colour.blue = 1.0 + snapshot.append_stroke(path, stroke, colour) + else: + rect = Graphene.Rect().init(0, 0, self.get_width(), self.get_height()) + ctx = snapshot.append_cairo(rect) + make_path(ctx) + + ctx.set_antialias(1) + ctx.set_line_width(lw) + ctx.set_dash((dash, dash), 0) + ctx.set_source_rgb(0, 0, 0) + ctx.stroke_preserve() + + ctx.set_dash((dash, dash), dash) + ctx.set_source_rgb(1, 1, 1) + ctx.stroke() + + def on_snapshot_event(self, snapshot): # to be overwritten by GTK4Agg or GTK4Cairo pass diff --git a/lib/matplotlib/backends/backend_gtk4agg.py b/lib/matplotlib/backends/backend_gtk4agg.py index 0af07850a30a..85b76d66e89d 100644 --- a/lib/matplotlib/backends/backend_gtk4agg.py +++ b/lib/matplotlib/backends/backend_gtk4agg.py @@ -1,39 +1,29 @@ -import numpy as np - -from .. import cbook from . import backend_agg, backend_gtk4 -from .backend_gtk4 import GLib, Gtk, _BackendGTK4 - -import cairo # Presence of cairo is already checked by _backend_gtk. +from .backend_gtk4 import GLib, Gdk, _BackendGTK4 class FigureCanvasGTK4Agg(backend_agg.FigureCanvasAgg, backend_gtk4.FigureCanvasGTK4): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._texture = None - def on_draw_event(self, widget, ctx): + def on_snapshot_event(self, snapshot): if self._idle_draw_id: GLib.source_remove(self._idle_draw_id) self._idle_draw_id = 0 self.draw() - scale = self.device_pixel_ratio - allocation = self.get_allocation() - - Gtk.render_background( - self.get_style_context(), ctx, - allocation.x, allocation.y, - allocation.width, allocation.height) - - buf = cbook._unmultiplied_rgba8888_to_premultiplied_argb32( - np.asarray(self.get_renderer().buffer_rgba())) - height, width, _ = buf.shape - image = cairo.ImageSurface.create_for_data( - buf.ravel().data, cairo.FORMAT_ARGB32, width, height) - image.set_device_scale(scale, scale) - ctx.set_source_surface(image, 0, 0) - ctx.paint() + view = self.get_renderer().buffer_rgba() + buf = GLib.Bytes.new(bytes(view)) + self._texture = Gdk.MemoryTexture.new(view.shape[1], view.shape[0], + Gdk.MemoryFormat.R8G8B8A8, + buf, view.strides[0]) - return False + okay, rect = self.compute_bounds(self) + if not okay: # Bounds were invalid for some reason. + return + snapshot.append_texture(self._texture, rect) @_BackendGTK4.export diff --git a/lib/matplotlib/backends/backend_gtk4cairo.py b/lib/matplotlib/backends/backend_gtk4cairo.py index 838ea03fcce6..119e99bb6e9f 100644 --- a/lib/matplotlib/backends/backend_gtk4cairo.py +++ b/lib/matplotlib/backends/backend_gtk4cairo.py @@ -1,7 +1,7 @@ from contextlib import nullcontext from .backend_cairo import FigureCanvasCairo -from .backend_gtk4 import GLib, Gtk, FigureCanvasGTK4, _BackendGTK4 +from .backend_gtk4 import GLib, Graphene, FigureCanvasGTK4, _BackendGTK4 class FigureCanvasGTK4Cairo(FigureCanvasCairo, FigureCanvasGTK4): @@ -10,7 +10,7 @@ def _set_device_pixel_ratio(self, ratio): # changes to the device pixel ratio. return False - def on_draw_event(self, widget, ctx): + def on_snapshot_event(self, snapshot): if self._idle_draw_id: GLib.source_remove(self._idle_draw_id) self._idle_draw_id = 0 @@ -18,12 +18,11 @@ def on_draw_event(self, widget, ctx): with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar else nullcontext()): - self._renderer.set_context(ctx) allocation = self.get_allocation() - Gtk.render_background( - self.get_style_context(), ctx, - allocation.x, allocation.y, - allocation.width, allocation.height) + bounds = Graphene.Rect().init(allocation.x, allocation.y, + allocation.width, allocation.height) + ctx = snapshot.append_cairo(bounds) + self._renderer.set_context(ctx) self.figure.draw(self._renderer) From 24bab6164a04291cda4e21181665dfb478764a2d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 27 Aug 2026 03:57:00 -0400 Subject: [PATCH 014/210] gtk4agg: Snap texture to pixels for sharper drawing On fractional HiDPI screens, just placing the texture directly will use default scaling, which will result in blurry output. By rounding the position and using nearest scaling, we get direct pixel output and no blurriness. --- lib/matplotlib/backends/backend_gtk4.py | 5 +++- lib/matplotlib/backends/backend_gtk4agg.py | 34 ++++++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/backends/backend_gtk4.py b/lib/matplotlib/backends/backend_gtk4.py index f483c7cdbd94..f757cdcfa39f 100644 --- a/lib/matplotlib/backends/backend_gtk4.py +++ b/lib/matplotlib/backends/backend_gtk4.py @@ -33,10 +33,13 @@ TimerGTK as TimerGTK4, ) +# With a new enough version, we can use nearest scaling instead of linear, which helps +# preserve sharpness on fractional HiDPI displays. +_USE_SCALED_TEXTURE = Gtk.check_version(4, 10, 0) is None # For GTK 4.14, there is enough path implementation to use the snapshot for the zoom # tool, and then we don't need Cairo. _USE_SNAPSHOT_ZOOM = Gtk.check_version(4, 14, 0) is None -if _USE_SNAPSHOT_ZOOM: +if _USE_SNAPSHOT_ZOOM or _USE_SCALED_TEXTURE: from gi.repository import Gsk else: try: diff --git a/lib/matplotlib/backends/backend_gtk4agg.py b/lib/matplotlib/backends/backend_gtk4agg.py index 85b76d66e89d..afc820bdf550 100644 --- a/lib/matplotlib/backends/backend_gtk4agg.py +++ b/lib/matplotlib/backends/backend_gtk4agg.py @@ -1,5 +1,10 @@ +from math import ceil, floor + from . import backend_agg, backend_gtk4 -from .backend_gtk4 import GLib, Gdk, _BackendGTK4 +from .backend_gtk4 import GLib, Gdk, Graphene, _BackendGTK4, _USE_SCALED_TEXTURE + +if _USE_SCALED_TEXTURE: + from .backend_gtk4 import Gsk class FigureCanvasGTK4Agg(backend_agg.FigureCanvasAgg, @@ -20,10 +25,29 @@ def on_snapshot_event(self, snapshot): Gdk.MemoryFormat.R8G8B8A8, buf, view.strides[0]) - okay, rect = self.compute_bounds(self) - if not okay: # Bounds were invalid for some reason. - return - snapshot.append_texture(self._texture, rect) + width = self.get_width() + height = self.get_height() + # Yes, Graphene.Rect really does have this strange initialization API. + area = Graphene.Rect() + Graphene.Rect.init( + area, + # Snap the texture to a physical pixel so it is not blurred. + 1 - ceil(self.device_pixel_ratio) / self.device_pixel_ratio, + 1 - ceil(self.device_pixel_ratio) / self.device_pixel_ratio, + ceil(width * self.device_pixel_ratio), + ceil(height * self.device_pixel_ratio)) + + snapshot.save() + snapshot.scale(1 / self.device_pixel_ratio, 1 / self.device_pixel_ratio) + + if (_USE_SCALED_TEXTURE and + self._texture.get_height() == floor(area.size.height)): + snapshot.append_scaled_texture(self._texture, Gsk.ScalingFilter.NEAREST, + area) + else: + snapshot.append_texture(self._texture, area) + + snapshot.restore() @_BackendGTK4.export From 8ba6a9296a16f00282c20a42705b93bda2713247 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 28 Aug 2026 01:02:42 -0400 Subject: [PATCH 015/210] gtk4: Switch to Gtk.Picture for toolbar For some reason, the Gtk.Image loads the icon at 16 pixels, even though the toolbar and the button are sized to 24. With Gtk.Picture, it displays at the "natural" size, which matches the 24 pixels we expect, and also resizes correctly if a theme uses a different size toolbar. --- lib/matplotlib/backends/backend_gtk4.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/backend_gtk4.py b/lib/matplotlib/backends/backend_gtk4.py index f757cdcfa39f..3ddd9e537215 100644 --- a/lib/matplotlib/backends/backend_gtk4.py +++ b/lib/matplotlib/backends/backend_gtk4.py @@ -368,10 +368,9 @@ def __init__(self, canvas): if text is None: self.append(Gtk.Separator()) continue - image = Gtk.Image.new_from_gicon( - Gio.Icon.new_for_string( - str(cbook._get_data_path('images', - f'{image_file}-symbolic.svg')))) + path = str(cbook._get_data_path('images', f'{image_file}-symbolic.svg')) + icon = Gtk.IconPaintable.new_for_file(Gio.File.new_for_path(path), 24, 1) + image = Gtk.Picture.new_for_paintable(icon) self._gtk_ids[text] = button = ( Gtk.ToggleButton() if callback in ['zoom', 'pan'] else Gtk.Button()) From ac0c83955039ece706c563260d943c64d8b943cb Mon Sep 17 00:00:00 2001 From: ShamikOfficial Date: Sun, 6 Sep 2026 20:08:57 -0700 Subject: [PATCH 016/210] FIX: flush rasterization before SVG close_group Pending mixed-mode rasterization left Axes.close_group on the Agg renderer, so SVG axes groups stayed open and later axes nested inside them when artists used rasterized=True. Closes #32174. Co-authored-by: Cursor --- lib/matplotlib/backends/backend_mixed.py | 9 +++++++ lib/matplotlib/tests/test_backend_svg.py | 32 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/lib/matplotlib/backends/backend_mixed.py b/lib/matplotlib/backends/backend_mixed.py index 02630f8debdd..a83f899357f3 100644 --- a/lib/matplotlib/backends/backend_mixed.py +++ b/lib/matplotlib/backends/backend_mixed.py @@ -68,6 +68,15 @@ def __getattr__(self, attr): # to the underlying C implementation). return getattr(self._renderer, attr) + def close_group(self, s): + # docstring inherited + # If rasterizing can be stopped, stop it before closing the group so + # the vector backend receives the matching close_group (#32174). + if self._raster_depth == 0 and self._rasterizing: + self.stop_rasterizing() + self._rasterizing = False + self._renderer.close_group(s) + def close_blend_group(self): # docstring inherited # If rasterizing can be stopped, stop it before closing the group diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py index 6b63990f7620..6c388dff9982 100644 --- a/lib/matplotlib/tests/test_backend_svg.py +++ b/lib/matplotlib/tests/test_backend_svg.py @@ -206,6 +206,38 @@ def count_tag(fig, tag): assert count_tag(fig5, "path") == 1 # axis patch +def test_rasterized_zorder_axes_hierarchy(): + # With rasterized artists ending an Axes draw, MixedModeRenderer must flush + # before close_group so SVG axes groups stay siblings (#32174). + fig, axs = plt.subplots(ncols=2) + for ax in axs: + ax.scatter([1, 2], [1, 2], rasterized=True, zorder=10) + + with BytesIO() as fd: + fig.savefig(fd, format='svg') + buf = fd.getvalue().decode() + + # Strip the default namespace so ElementTree tag matching stays simple. + buf = buf.replace(' xmlns="http://www.w3.org/2000/svg"', '', 1) + root = xml.etree.ElementTree.fromstring(buf) + + axes_parents = {} + + def walk(elem, axes_ancestor=None): + gid = elem.get('id') if elem.tag == 'g' else None + next_ancestor = axes_ancestor + if gid is not None and gid.startswith('axes_'): + axes_parents[gid] = axes_ancestor + next_ancestor = gid + for child in elem: + walk(child, next_ancestor) + + walk(root) + assert set(axes_parents) >= {'axes_1', 'axes_2'} + assert axes_parents['axes_1'] is None + assert axes_parents['axes_2'] is None + + # Use Computer Modern Sans Serif, not Helvetica (which has no \textwon). @mpl.style.context('default') @needs_usetex From e988dd4fde4db0d97ed34676e1b4153f87e03936 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 4 Sep 2026 22:56:30 -0400 Subject: [PATCH 017/210] TST: Remove redundant test_mathtext.py::test_fontinfo This test just checks `get_sfnt_table('head')` for DejaVu Sans, but there is a more comprehensive test of all SFNT tables in `test_ft2font.py::test_ft2font_get_sfnt_table`. --- lib/matplotlib/tests/test_mathtext.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py index 1e1bf793cdae..170e61c3ab61 100644 --- a/lib/matplotlib/tests/test_mathtext.py +++ b/lib/matplotlib/tests/test_mathtext.py @@ -292,14 +292,6 @@ def test_short_long_accents(fig_test, fig_ref): 0, .5, "$" + "".join(fr"\{l} a" for l in corresponding_long_accs) + "$") -def test_fontinfo(): - fontpath = mpl.font_manager.findfont("DejaVu Sans") - font = mpl.ft2font.FT2Font(fontpath) - table = font.get_sfnt_table("head") - assert table is not None - assert table['version'] == (1, 0) - - # See gh-26152 for more context on this xfail @pytest.mark.xfail(pyparsing_version.release == (3, 1, 0), reason="Error messages are incorrect for this version") From d0a969a725e7a17fe5366b7fa0d5bded7995879a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 5 Sep 2026 02:22:58 -0400 Subject: [PATCH 018/210] Use more specific patterns for bundled mathtext fonts Because we previously only asked for a font family (and sometimes a weight/style), mathtext fonts were at the whim of rcParams for all other settings. This could mean that we would look for an non-existent weight, or even set the normal font to italic unintentionally. The fonts that are available for mathtext are (for now) fixed and bundled, and we only intend for them to work with the exact fonts we have. So use more specific fontconfig patterns that should always match the fonts that we have. While it could be possible to simply hard-code these paths relative to our data path, it seems that way back in 157a0598a02f613c06245de0b3bc81d62765eac7, that implementation was changed to `findfont` intentionally to avoid duplicate embeddings. --- lib/matplotlib/_mathtext.py | 28 +++++++++++++++---------- lib/matplotlib/tests/test_mathtext.py | 30 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 319d6f065389..62473c1d1f00 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -364,6 +364,12 @@ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlag self._fonts['default'] = default_font self._fonts['regular'] = default_font + def _normalize_font_pattern(self, pattern: str) -> str: + for option in ['stretch', 'style', 'variant', 'weight']: + if f':{option}=' not in pattern: + pattern = f'{pattern}:{option}=normal' + return pattern + def _get_font(self, font: str) -> FT2Font: basename = self.fontmap.get(font, font) cached_font = self._fonts.get(basename) @@ -492,7 +498,7 @@ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlag super().__init__(default_font_prop, load_glyph_flags) for key, val in self._fontmap.items(): - fullpath = findfont(val) + fullpath = findfont(self._normalize_font_pattern(val)) self.fontmap[key] = fullpath self.fontmap[val] = fullpath @@ -617,7 +623,7 @@ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlag } for size, name in stixsizedaltfonts.items(): - fullpath = findfont(name) + fullpath = findfont(self._normalize_font_pattern(name)) self.fontmap[size] = fullpath self.fontmap[name] = fullpath @@ -719,7 +725,7 @@ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlag '5': 'STIXSizeFiveSym', }) for key, name in self._fontmap.items(): - fullpath = findfont(name) + fullpath = findfont(self._normalize_font_pattern(name)) self.fontmap[key] = fullpath self.fontmap[name] = fullpath @@ -748,9 +754,9 @@ class DejaVuSerifFonts(DejaVuFonts): """ _fontmap = { 'rm': 'DejaVu Serif', - 'it': 'DejaVu Serif:italic', + 'it': 'DejaVu Serif:style=italic', 'bf': 'DejaVu Serif:weight=bold', - 'bfit': 'DejaVu Serif:italic:bold', + 'bfit': 'DejaVu Serif:style=italic:weight=bold', 'sf': 'DejaVu Sans', 'tt': 'DejaVu Sans Mono', 'ex': 'DejaVu Serif Display', @@ -769,9 +775,9 @@ class DejaVuSansFonts(DejaVuFonts): """ _fontmap = { 'rm': 'DejaVu Sans', - 'it': 'DejaVu Sans:italic', + 'it': 'DejaVu Sans:style=italic', 'bf': 'DejaVu Sans:weight=bold', - 'bfit': 'DejaVu Sans:italic:bold', + 'bfit': 'DejaVu Sans:style=italic:weight=bold', 'sf': 'DejaVu Sans', 'tt': 'DejaVu Sans Mono', 'ex': 'DejaVu Sans Display', @@ -796,11 +802,11 @@ class StixFonts(UnicodeFonts): """ _fontmap = { 'rm': 'STIXGeneral', - 'it': 'STIXGeneral:italic', + 'it': 'STIXGeneral:style=italic', 'bf': 'STIXGeneral:weight=bold', - 'bfit': 'STIXGeneral:italic:bold', + 'bfit': 'STIXGeneral:style=italic:weight=bold', 'nonunirm': 'STIXNonUnicode', - 'nonuniit': 'STIXNonUnicode:italic', + 'nonuniit': 'STIXNonUnicode:style=italic', 'nonunibf': 'STIXNonUnicode:weight=bold', '0': 'STIXGeneral', '1': 'STIXSizeOneSym', @@ -815,7 +821,7 @@ class StixFonts(UnicodeFonts): def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags): TruetypeFonts.__init__(self, default_font_prop, load_glyph_flags) for key, name in self._fontmap.items(): - fullpath = findfont(name) + fullpath = findfont(self._normalize_font_pattern(name)) self.fontmap[key] = fullpath self.fontmap[name] = fullpath diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py index 170e61c3ab61..4c6169f20083 100644 --- a/lib/matplotlib/tests/test_mathtext.py +++ b/lib/matplotlib/tests/test_mathtext.py @@ -1,6 +1,7 @@ from __future__ import annotations import io +import logging from pathlib import Path import platform import re @@ -371,6 +372,35 @@ def test_mathtext_exceptions(math, msg): parser.parse(math) +def test_mathtext_fonts(caplog): + # Changing these `font.*` rcParams should not affect mathtext, as that uses bundled + # fonts with a specific mapping to style/weight. TODO: font.stretch and font.variant + # are difficult to test as we don't have anything that might accidentally be + # substituted there. + mpl.rcParams['font.style'] = 'italic' + mpl.rcParams['font.weight'] = 100 + # Use explicitly available default so that it doesn't warn. + default_font = fm.FontProperties('DejaVu Sans:style=normal:weight=normal') + + _mathtext.BakomaFonts(default_font, LoadFlags.DEFAULT) + dejavusans = _mathtext.DejaVuSansFonts(default_font, LoadFlags.DEFAULT) + dejavuserif = _mathtext.DejaVuSerifFonts(default_font, LoadFlags.DEFAULT) + stix = _mathtext.StixFonts(default_font, LoadFlags.DEFAULT) + stixsans = _mathtext.StixSansFonts(default_font, LoadFlags.DEFAULT) + + # Setting font.style should not have accidentally changed any roman font to italic. + assert dejavusans.fontmap['rm'].endswith('DejaVuSans.ttf') + assert dejavuserif.fontmap['rm'].endswith('DejaVuSerif.ttf') + assert stix.fontmap['rm'].endswith('STIXGeneral.ttf') + assert stixsans.fontmap['rm'].endswith('STIXGeneral.ttf') + # No bakoma font is actually italic, so that setting won't affect it. + + # If `font.weight` leaked into the mathtext setup, then it should cause a warning to + # be logged from the font manager for a missing font weight. + records = [record for record in caplog.records if record.levelno == logging.WARNING] + assert records == [] + + def test_get_unicode_index_exception(): with pytest.raises(ValueError): _mathtext.get_unicode_index(r'\foo') From 3694152533988eca9343cb00030f45b4cb37f57d Mon Sep 17 00:00:00 2001 From: Christian Aurich Date: Wed, 9 Sep 2026 21:07:20 -0300 Subject: [PATCH 019/210] FIX: make EngFormatter respect axes.formatter.use_locale rcParam EngFormatter subclasses ScalarFormatter, but the inherited locale machinery is reachable only in the offset path. The normal engineering formatting path both forces the flag off at construction, by passing useLocale=False to super().__init__, and bypasses locale-aware formatting, by interpolating the mantissa directly. The rcParam therefore had no effect, and set_useLocale flipped a flag that format_data never consulted. Pass useLocale through to ScalarFormatter and add the matching keyword argument, so that the rcParam applies and an explicit value overrides it. When locale formatting is on, the mantissa goes through locale.format_string, and the separators it introduces are escaped for mathtext the same way ScalarFormatter already escapes them. --- .../next_whats_new/engformatter_locale.rst | 17 ++++++++ lib/matplotlib/tests/test_ticker.py | 39 +++++++++++++++++++ lib/matplotlib/ticker.py | 22 +++++++++-- lib/matplotlib/ticker.pyi | 1 + 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 doc/release/next_whats_new/engformatter_locale.rst diff --git a/doc/release/next_whats_new/engformatter_locale.rst b/doc/release/next_whats_new/engformatter_locale.rst new file mode 100644 index 000000000000..69252c74bb2f --- /dev/null +++ b/doc/release/next_whats_new/engformatter_locale.rst @@ -0,0 +1,17 @@ +``EngFormatter`` now respects ``axes.formatter.use_locale`` +----------------------------------------------------------- + +`~matplotlib.ticker.EngFormatter` now formats the decimal separator according to +the current locale, like `~matplotlib.ticker.ScalarFormatter` already did. This +is controlled by the :rc:`axes.formatter.use_locale` rcParam, or by the new +*useLocale* keyword argument: + +.. code-block:: python + + import locale + from matplotlib.ticker import EngFormatter + + locale.setlocale(locale.LC_ALL, "de_DE.UTF-8") + + ax.yaxis.set_major_formatter(EngFormatter(places=2, useLocale=True)) + # tick labels now read "555,10 m" instead of "555.10 m" diff --git a/lib/matplotlib/tests/test_ticker.py b/lib/matplotlib/tests/test_ticker.py index 189949638100..2a1684761aa0 100644 --- a/lib/matplotlib/tests/test_ticker.py +++ b/lib/matplotlib/tests/test_ticker.py @@ -1810,6 +1810,45 @@ def test_locale_comma(): pytest.skip(skip_msg) +def _impl_engformatter_locale(): + try: + locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8') + except locale.Error: + print('SKIP: Locale de_DE.UTF-8 is not supported on this machine') + return + # EngFormatter is a ScalarFormatter subclass, so it must honour the + # axes.formatter.use_locale rcParam like its parent does. + with mpl.rc_context(rc={'axes.formatter.use_locale': True}): + fmt = mticker.EngFormatter(places=2) + assert fmt.get_useLocale() + assert fmt.format_data(0.5551) == '555,10 m' + # An explicit keyword argument overrides the rcParam. + fmt = mticker.EngFormatter(places=2, useLocale=False) + assert not fmt.get_useLocale() + assert fmt.format_data(1234.5) == '1.23 k' + fmt = mticker.EngFormatter(places=2, useLocale=True) + assert fmt.get_useLocale() + assert fmt.format_data(1234.5) == '1,23 k' + # The inherited setter also reaches the engineering formatting path. + fmt = mticker.EngFormatter(places=2, useLocale=False) + fmt.set_useLocale(True) + assert fmt.format_data(1234.5) == '1,23 k' + # Separators are escaped for mathtext, as ScalarFormatter does. + fmt = mticker.EngFormatter(places=2, useLocale=True, useMathText=True) + assert fmt.format_data(0.5551) == '$555{,}10$ m' + + +def test_engformatter_locale(): + proc = mpl.testing.subprocess_run_helper( + _impl_engformatter_locale, timeout=60, extra_env={'MPLBACKEND': 'Agg'}) + skip_msg = next((line[len('SKIP:'):].strip() + for line in proc.stdout.splitlines() + if line.startswith('SKIP:')), + '') + if skip_msg: + pytest.skip(skip_msg) + + def test_majformatter_type(): fig, ax = plt.subplots() with pytest.raises(TypeError): diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 391e24dd2a06..2116ce8c38a5 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1433,7 +1433,7 @@ class EngFormatter(ScalarFormatter): } def __init__(self, unit="", places=None, sep=" ", *, usetex=None, - useMathText=None, useOffset=False): + useMathText=None, useOffset=False, useLocale=None): r""" Parameters ---------- @@ -1476,6 +1476,12 @@ def __init__(self, unit="", places=None, sep=" ", *, usetex=None, 3 digits. See also `.set_useOffset`. .. versionadded:: 3.10 + + useLocale : bool, default: :rc:`axes.formatter.use_locale`. + Whether to use locale settings for decimal sign and positive sign. + See `.set_useLocale`. + + .. versionadded:: 3.12 """ self.unit = unit self.places = places @@ -1483,7 +1489,7 @@ def __init__(self, unit="", places=None, sep=" ", *, usetex=None, super().__init__( useOffset=useOffset, useMathText=useMathText, - useLocale=False, + useLocale=useLocale, usetex=usetex, ) @@ -1598,10 +1604,18 @@ def format_data(self, value): suffix = f"{self.sep}{unit_prefix}{self.unit}" else: suffix = "" + if self._useLocale: + mant_str = locale.format_string(f"%{fmt}", (mant,), True) + if self._useMathText: + # Escape the separators introduced by locale.format_string, so + # that mathtext does not apply punctuation spacing to them. + mant_str = mant_str.replace(",", "{,}") + else: + mant_str = f"{mant:{fmt}}" if self._usetex or self._useMathText: - return f"${mant:{fmt}}${suffix}" + return f"${mant_str}${suffix}" else: - return f"{mant:{fmt}}{suffix}" + return f"{mant_str}{suffix}" class PercentFormatter(Formatter): diff --git a/lib/matplotlib/ticker.pyi b/lib/matplotlib/ticker.pyi index 8625c3ebd3fd..097938a28152 100644 --- a/lib/matplotlib/ticker.pyi +++ b/lib/matplotlib/ticker.pyi @@ -150,6 +150,7 @@ class EngFormatter(ScalarFormatter): usetex: bool | None = ..., useMathText: bool | None = ..., useOffset: bool | float | None = ..., + useLocale: bool | None = ..., ) -> None: ... def format_eng(self, num: float) -> str: ... From d608076b92d7d34a5c0f36ffb6cd872466e32d2d Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 10 Sep 2026 13:49:12 -0400 Subject: [PATCH 020/210] Review comments --- .../next_whats_new/contourset_set_data.rst | 8 ++++---- galleries/examples/animation/simple_anim.py | 4 ++-- lib/matplotlib/cbook.py | 6 ++++-- lib/matplotlib/contour.py | 16 +++++++++------- lib/matplotlib/tests/test_contour.py | 5 +++++ 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/release/next_whats_new/contourset_set_data.rst b/doc/release/next_whats_new/contourset_set_data.rst index bd6d3b56a1f4..1e5773f1b664 100644 --- a/doc/release/next_whats_new/contourset_set_data.rst +++ b/doc/release/next_whats_new/contourset_set_data.rst @@ -1,12 +1,12 @@ -Contour sets can be updated with new data ------------------------------------------ +A ``ContourSet`` can be updated with new data +--------------------------------------------- `.ContourSet.set_data` recontours new data using the existing artist, instead of -requiring the contour set to be removed and recreated:: +requiring the ``ContourSet`` to be removed and recreated:: cs = ax.contour(X, Y, Z) cs.set_data(X, Y, Z2) It works for `~.Axes.contour`, `~.Axes.contourf`, `~.Axes.tricontour` and `~.Axes.tricontourf`. The contour levels are kept, so the colors, the colorbar -and the legend entries of the contour set remain valid. This is useful for +and the legend entries of the ``ContourSet`` remain valid. This is useful for animations and other interactive updates. diff --git a/galleries/examples/animation/simple_anim.py b/galleries/examples/animation/simple_anim.py index c1c37527ee5d..d253bf8e1c58 100644 --- a/galleries/examples/animation/simple_anim.py +++ b/galleries/examples/animation/simple_anim.py @@ -39,8 +39,8 @@ def animate(i): # %% # Contours are updated the same way, with `.ContourSet.set_data`. Recontouring -# the existing artist is faster than removing the contour set and making a new -# one, and it keeps the contours in the same place in the draw order, which +# the existing artist is faster than removing the ``ContourSet`` and making a +# new one, and it keeps the contours in the same place in the draw order, which # matters when blitting. The levels are not recomputed, so the colors mean # the same thing in every frame. diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 9c05273bdb35..46e8257f2f2f 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -2185,13 +2185,15 @@ def _safe_state_update(obj): Yields a snapshot of ``obj.__dict__``, which is restored if the body raises, so that an update mutating *obj* incrementally -- and able to fail partway through -- leaves it as it was rather than half-updated. + + The snapshot is shallow: it undoes attributes being *rebound*, not an object that + one of them refers to being mutated in place, nor changes to other objects. """ state = obj.__dict__.copy() try: yield state except Exception: - obj.__dict__.clear() - obj.__dict__.update(state) + obj.__dict__ = state raise diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index e6ace0b6b3aa..a9a82d2cca80 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -901,7 +901,7 @@ def set_data(self, *args, **kwargs): set_data(X, Y, Z) This reuses the existing artist, which is faster than removing the - contour set and creating a new one, and keeps its styling and its + ``ContourSet`` and creating a new one, and keeps its styling and its place in the draw tree. .. versionadded:: 3.12 @@ -910,7 +910,7 @@ def set_data(self, *args, **kwargs): ---------- *args The new data, interpreted as by the function that created this - contour set, i.e. `~.Axes.contour`, `~.Axes.contourf`, + ``ContourSet``, i.e. `~.Axes.contour`, `~.Axes.contourf`, `~.Axes.tricontour` or `~.Axes.tricontourf`. **kwargs @@ -921,13 +921,13 @@ def set_data(self, *args, **kwargs): `~.Axes.tricontour`. Keywords that control how the contours *look* (*levels*, *colors*, *cmap*, *linewidths*, ...) raise `TypeError`; set those with the corresponding `.Collection` setters, or create a new - contour set. + ``ContourSet``. Notes ----- The *levels* are not recomputed; the new data is contoured at the levels already in use, so that the colors and the colorbar stay - valid. Create a new contour set if you need different levels. + valid. Create a new ``ContourSet`` if you need different levels. Existing contour labels are not moved. The Axes limits are not rescaled, as for other artists' data setters. @@ -1401,15 +1401,17 @@ def _process_args(self, *args, corner_mask=None, algorithm=None, **kwargs): mpl.rcParams.validate["contour.algorithm"](algorithm) self._algorithm = algorithm - if corner_mask is None: - corner_mask = self._corner_mask if corner_mask is None: if self._algorithm == "mpl2005": # mpl2005 does not support corner_mask=True so if not - # specifically requested then disable it. + # specifically requested then disable it, even when set_data + # switches to it from an algorithm that had it enabled. corner_mask = False + elif self._corner_mask is not None: + corner_mask = self._corner_mask else: corner_mask = mpl.rcParams['contour.corner_mask'] + self._corner_mask = corner_mask x, y, z = self._contour_args(args, kwargs) diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py index 094c2bdc7978..5546d8370871 100644 --- a/lib/matplotlib/tests/test_contour.py +++ b/lib/matplotlib/tests/test_contour.py @@ -958,6 +958,11 @@ def test_contour_set_data_keeps_algorithm_and_corner_mask(): cs.set_data(z * 2, algorithm='serial', corner_mask=True) assert cs._algorithm == 'serial' assert cs._corner_mask is True + # Switching to mpl2005 turns corner_mask off unless requested, as contour() does, + # rather than inheriting a corner_mask=True that mpl2005 does not support. + cs = plt.figure().add_subplot().contour(z) + cs.set_data(z * 2, algorithm='mpl2005') + assert cs._corner_mask is False def _assert_set_data_rejects(exc, match, args=(), **kwargs): From 3cfa4550626db82f51de9f98518de7ac432e7855 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Fri, 11 Sep 2026 09:51:34 -0700 Subject: [PATCH 021/210] Run agentscan if first-contribution left a comment --- .github/workflows/pr_welcome.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_welcome.yml b/.github/workflows/pr_welcome.yml index f8b004dc5468..b71cb4478727 100644 --- a/.github/workflows/pr_welcome.yml +++ b/.github/workflows/pr_welcome.yml @@ -15,8 +15,10 @@ jobs: permissions: issues: write pull-requests: write + contents: read steps: - - uses: plbstl/first-contribution@2c36bdb58684587f60549a69aaa3ec00b9d5f4fe # v4.3.3 + - id: first-contribution + uses: plbstl/first-contribution@2c36bdb58684587f60549a69aaa3ec00b9d5f4fe # v4.3.3 with: labels: first-contribution skip-internal-contributors: false @@ -50,3 +52,16 @@ jobs: [Code of Conduct](https://github.com/matplotlib/matplotlib/blob/main/CODE_OF_CONDUCT.md). issue-opened-msg: "" + - name: Run agentscan if first-contribution left a comment + if: "${{ steps.first-contribution.outputs.comment-url != '' }}" + uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e # v2.5.0 + with: + mode: labels + scan-pull-requests: true + scan-issues: true + allowed-users: "meeseeksmachine" + label-mixed: "automation: mixed" + label-automated: "automation: automated" + label-community-flagged: "automation: flagged" + auto-close: false + honeypot: false From 62e3277d1df00bdc967d87040cd4097fdf16a814 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Fri, 11 Sep 2026 10:40:20 -0700 Subject: [PATCH 022/210] Change commit hash to 2.5.0 --- .github/workflows/pr_welcome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_welcome.yml b/.github/workflows/pr_welcome.yml index b71cb4478727..e9d33be877cf 100644 --- a/.github/workflows/pr_welcome.yml +++ b/.github/workflows/pr_welcome.yml @@ -54,7 +54,7 @@ jobs: issue-opened-msg: "" - name: Run agentscan if first-contribution left a comment if: "${{ steps.first-contribution.outputs.comment-url != '' }}" - uses: MatteoGabriele/agentscan-action@c7d61446e7aece6bdd3edcee4558bbfc0392615e # v2.5.0 + uses: MatteoGabriele/agentscan-action@8112fb79b33fafb8506159df20129a34209ac410 # v2.5.0 with: mode: labels scan-pull-requests: true From 569ed898aa89c39fb4cd2b6161beec2e58f0935b Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Sat, 12 Sep 2026 15:26:22 +0100 Subject: [PATCH 023/210] ENH: AnchoredOffsetbox for (Sub)Figures --- .../next_whats_new/fig_anchored_offsetbox.rst | 32 +++++++++++++++++++ galleries/examples/misc/anchored_artists.py | 6 ++-- lib/matplotlib/offsetbox.py | 15 ++++++--- lib/matplotlib/tests/test_offsetbox.py | 23 +++++++++++++ 4 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 doc/release/next_whats_new/fig_anchored_offsetbox.rst diff --git a/doc/release/next_whats_new/fig_anchored_offsetbox.rst b/doc/release/next_whats_new/fig_anchored_offsetbox.rst new file mode 100644 index 000000000000..244b253517ca --- /dev/null +++ b/doc/release/next_whats_new/fig_anchored_offsetbox.rst @@ -0,0 +1,32 @@ +``AnchoredOffsetbox`` and ``AnchoredText`` for ``Figure`` and ``SubFigure`` +--------------------------------------------------------------------------- + +The `.AnchoredOffsetbox` and `.AnchoredText` artists may now be directly added to a +`.Figure` or `.SubFigure` and by default will be anchored relative to their parent +``(Sub)Figure``. + + +.. plot:: + :include-source: true + :alt: The left half of the figure contains two text boxes with black outlines. One in the top left of the figure reads "Anchored to Figure". One at the bottom and to the left the vertical center line reads "Anchored to SubFigure". A third box containing a blue circle is halfway up and to the right of the vertical center line. + + import matplotlib.pyplot as plt + import matplotlib.patches as mpatches + from matplotlib.offsetbox import AnchoredText, AnchoredOffsetbox, DrawingArea + + fig = plt.figure() + + sfig1, sfig2 = fig.subfigures(ncols=2) + sfig1.set_facecolor("lemonchiffon") + sfig2.set_facecolor("lightcyan") + + fig_text = AnchoredText("Anchored to Figure", loc="upper left") + fig.add_artist(fig_text) + + sfig_text = AnchoredText("Anchored to SubFigure", loc="lower right") + sfig1.add_artist(sfig_text) + + area = DrawingArea(width=30, height=30) + area.add_artist(mpatches.Circle((15, 15), 15, fc="tab:blue")) + box = AnchoredOffsetbox(child=area, loc="center left") + sfig2.add_artist(box) diff --git a/galleries/examples/misc/anchored_artists.py b/galleries/examples/misc/anchored_artists.py index be600449bba6..af807eecdb60 100644 --- a/galleries/examples/misc/anchored_artists.py +++ b/galleries/examples/misc/anchored_artists.py @@ -22,12 +22,12 @@ from matplotlib.patches import Circle, Ellipse -def draw_text(ax): +def draw_text(fig): """Draw a text-box anchored to the upper-left corner of the figure.""" box = AnchoredOffsetbox(child=TextArea("Figure 1a"), loc="upper left", frameon=True) box.patch.set_boxstyle("round,pad=0.,rounding_size=0.2") - ax.add_artist(box) + fig.add_artist(box) def draw_circles(ax): @@ -68,7 +68,7 @@ def draw_sizebar(ax): fig, ax = plt.subplots() ax.set_aspect(1) -draw_text(ax) +draw_text(fig) draw_circles(ax) draw_ellipse(ax) draw_sizebar(ax) diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py index ca19a26f2b17..37589ad73749 100644 --- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -909,10 +909,14 @@ class AnchoredOffsetbox(OffsetBox): """ An OffsetBox placed according to location *loc*. - AnchoredOffsetbox has a single child. When multiple children are needed, - use an extra OffsetBox to enclose them. By default, the offset box is - anchored against its parent Axes. You may explicitly specify the - *bbox_to_anchor*. + AnchoredOffsetbox has a single child. When multiple children are needed, use an + extra OffsetBox to enclose them. By default, the offset box is anchored against its + parent Axes, SubFigure or Figure. You may explicitly specify the *bbox_to_anchor*. + + .. versionadded:: 3.12 + `.AnchoredOffsetbox` can now be added directly to a `.Figure` or `.SubFigure`, + and will by default be anchored to that parent. + """ zorder = 5 # zorder of the legend @@ -1024,7 +1028,8 @@ def get_bbox(self, renderer): def get_bbox_to_anchor(self): """Return the bbox that the box is anchored to.""" if self._bbox_to_anchor is None: - return self.axes.bbox + return (self.axes.bbox if self.axes is not None else + self.get_figure(root=False).bbox) else: transform = self._bbox_to_anchor_transform if transform is None: diff --git a/lib/matplotlib/tests/test_offsetbox.py b/lib/matplotlib/tests/test_offsetbox.py index 4ea6688d8651..514e0c10e556 100644 --- a/lib/matplotlib/tests/test_offsetbox.py +++ b/lib/matplotlib/tests/test_offsetbox.py @@ -507,3 +507,26 @@ def test_anchored_offsetbox_tuple_and_float_borderpad(): # in the y-direction. assert pos_tuple_asym.x0 > pos_float.x0 assert pos_tuple_asym.y0 < pos_float.y0 + + +def test_figure_anchored_offsetbox(): + fig = plt.figure() + sfig1, _ = fig.subfigures(ncols=2) + + box1 = AnchoredText("wibble", loc="upper left", borderpad=0) + fig.add_artist(box1) + + box2 = AnchoredText("meep", loc="lower right", borderpad=0) + sfig1.add_artist(box2) + + fig.draw_without_rendering() + + # Upper left of figure + tight_bb1 = box1.get_tightbbox() + assert tight_bb1.x0 == pytest.approx(0) + assert tight_bb1.y1 == pytest.approx(480) + + # lower right of lefthand subfigure + tight_bb2 = box2.get_tightbbox() + assert tight_bb2.x1 == pytest.approx(320) + assert tight_bb2.y0 == pytest.approx(0) From 9b9dacfa687e02377bdcb012f23729710b1e938d Mon Sep 17 00:00:00 2001 From: daniel Date: Sun, 13 Sep 2026 00:26:38 -0400 Subject: [PATCH 024/210] Fix selectors when the onselect callback raises `_SelectorWidget.release` cleared `_eventpress` and `_eventrelease` only after `self._release(event)` returned, but `_release` is what calls the user's `onselect` callback. If that callback raised, the cleanup was skipped, and the stale `_eventpress` made `ignore` stop rejecting events outside the selector's Axes. The failed selector then kept reacting to later interactions, including events meant for another selector. Move the cleanup into a `finally` block so the exception still propagates while the selector stays usable afterwards. This covers all `_SelectorWidget` subclasses, which all call `onselect` from `_release`. Fixes #32327. --- lib/matplotlib/tests/test_widgets.py | 104 +++++++++++++++++++++++++++ lib/matplotlib/widgets.py | 11 +-- 2 files changed, 111 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/tests/test_widgets.py b/lib/matplotlib/tests/test_widgets.py index 1aa6b70e7790..c14de4bfb503 100644 --- a/lib/matplotlib/tests/test_widgets.py +++ b/lib/matplotlib/tests/test_widgets.py @@ -681,6 +681,110 @@ def test_span_selector_onselect(ax, interactive): onselect.assert_called_once() +@pytest.mark.parametrize('selector_factory', [ + lambda ax, onselect: widgets.SpanSelector(ax, onselect, 'horizontal'), + lambda ax, onselect: widgets.SpanSelector(ax, onselect, 'horizontal', + interactive=True), + lambda ax, onselect: widgets.RectangleSelector(ax, onselect), + lambda ax, onselect: widgets.RectangleSelector(ax, onselect, + interactive=True), +], ids=['SpanSelector', 'SpanSelector-interactive', + 'RectangleSelector', 'RectangleSelector-interactive']) +def test_selector_callback_exception_resets_state(ax, selector_factory): + # An exception from onselect must not leave the selector in a dragging + # state. + calls = [] + + def onselect(*args): + calls.append(args) + if len(calls) == 1: + raise RuntimeError("callback failure") + + tool = selector_factory(ax, onselect) + # The default handler prints callback exceptions instead of raising them + # when a GUI framework is running; force propagation for this test. + ax.figure.canvas.callbacks.exception_handler = None + + # Drag with the 'move' modifier held so that the 'move' state really is + # set when the callback raises. + with pytest.raises(RuntimeError, match="callback failure"): + MouseEvent._from_ax_coords( + "button_press_event", ax, (100, 100), 1, key=' ')._process() + MouseEvent._from_ax_coords( + "motion_notify_event", ax, (150, 150), 1, key=' ')._process() + MouseEvent._from_ax_coords( + "button_release_event", ax, (150, 150), 1, key=' ')._process() + + assert tool._eventpress is None + assert tool._eventrelease is None + assert 'move' not in tool._state + + # The selector can still be used after the callback raised. Start away + # from the previous shape so an interactive selector creates a new one + # rather than moving the existing one. + click_and_drag(tool, start=(20, 20), end=(70, 70)) + assert len(calls) == 2 + assert tool._selection_completed + + +def test_lasso_selector_callback_exception_resets_state(ax): + # LassoSelector uses the shared release handler but has a different + # callback signature. + calls = [] + + def onselect(verts): + calls.append(verts) + if len(calls) == 1: + raise RuntimeError("callback failure") + + tool = widgets.LassoSelector(ax, onselect) + ax.figure.canvas.callbacks.exception_handler = None + + with pytest.raises(RuntimeError, match="callback failure"): + click_and_drag(tool, start=(100, 100), end=(150, 150)) + + assert tool._eventpress is None + assert tool._eventrelease is None + + click_and_drag(tool, start=(100, 100), end=(150, 150)) + assert len(calls) == 2 + + +def test_span_selector_callback_exception_does_not_leak_to_other_selector(): + # A failed selector must not consume events that are meant for a selector + # on another Axes. + fig, (ax1, ax2) = plt.subplots(2, 1) + fig.canvas.draw() + # The default handler prints callback exceptions instead of raising them + # when a GUI framework is running; force propagation for this test. + fig.canvas.callbacks.exception_handler = None + + top_calls = [] + + def failing_onselect(vmin, vmax): + top_calls.append((vmin, vmax)) + raise RuntimeError("callback failure") + + selections = [] + top = widgets.SpanSelector(ax1, failing_onselect, 'horizontal') + bottom = widgets.SpanSelector( + ax2, lambda vmin, vmax: selections.append((vmin, vmax)), + 'horizontal') + + with pytest.raises(RuntimeError, match="callback failure"): + click_and_drag(top, start=(0.2, 0.2), end=(0.5, 0.2)) + + top_extents = top.extents + + click_and_drag(bottom, start=(0.2, 0.2), end=(0.6, 0.2)) + + # The failed selector must not react to the events on the other Axes. + assert len(top_calls) == 1 + assert top.extents == top_extents + assert selections == [(0.2, 0.6)] + assert bottom._selection_completed + + @pytest.mark.parametrize('ignore_event_outside', [True, False]) def test_span_selector_ignore_outside(ax, ignore_event_outside): onselect = mock.Mock(spec=noop, return_value=None) diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index daec97f42ce6..7299883b22b8 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2502,10 +2502,13 @@ def release(self, event): if not self.ignore(event) and self._eventpress: event = self._clean_event(event) self._eventrelease = event - self._release(event) - self._eventpress = None - self._eventrelease = None - self._state.discard('move') + try: + self._release(event) + finally: + # The callback may raise; reset the state regardless. + self._eventpress = None + self._eventrelease = None + self._state.discard('move') return True return False From c369c499ca32e056dbb28f4863192832e88e0e61 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 16 Sep 2026 00:34:45 +0200 Subject: [PATCH 025/210] DOC: Document state of PieContainer as discussed in https://github.com/matplotlib/matplotlib/issues/32320#issuecomment-5667242046 --- lib/matplotlib/container.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/container.py b/lib/matplotlib/container.py index 96b14cfd26f7..508eaeec189e 100644 --- a/lib/matplotlib/container.py +++ b/lib/matplotlib/container.py @@ -150,11 +150,22 @@ def __init__(self, lines, has_xerr=False, has_yerr=False, **kwargs): class PieContainer: """ - Container for the artists of pie charts (e.g. created by `.Axes.pie`). + Preliminary aggregating class for the artists of pie charts (e.g. created by + `.Axes.pie`). .. versionadded:: 3.11 .. warning:: + Limited guaranteed public API: + + - the below given attributes + - the methods ``remove()`` and ``add_texts()`` + - tuple unpacking of the container into ``(wedges, texts)`` for backward + compatibility + + This is currently not a `.Container`, it's still to be decided whether this + is promoted to a proper `.Container` or developed in a different direction. + The class name ``PieContainer`` name is provisional and may change in future to reflect development of its functionality. From d386570c80602837015dee17264450214aa39b61 Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Thu, 17 Sep 2026 09:54:17 -0400 Subject: [PATCH 026/210] Fix app icon bug on Windows when running IPython --- lib/matplotlib/backends/_backend_tk.py | 38 ++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/backends/_backend_tk.py b/lib/matplotlib/backends/_backend_tk.py index 1149d14ad98c..a0834c7aa8d0 100644 --- a/lib/matplotlib/backends/_backend_tk.py +++ b/lib/matplotlib/backends/_backend_tk.py @@ -546,23 +546,6 @@ def create_with_canvas(cls, canvas_class, figure, num): window = tk.Tk(className="matplotlib") window.withdraw() - # Put a Matplotlib icon on the window rather than the default tk - # icon. See https://www.tcl.tk/man/tcl/TkCmd/wm.html#M50 - # - # `ImageTk` can be replaced with `tk` whenever the minimum - # supported Tk version is increased to 8.6, as Tk 8.6+ natively - # supports PNG images. - icon_fname = str(cbook._get_data_path( - 'images/matplotlib_small.png')) - icon_img = ImageTk.PhotoImage(file=icon_fname, master=window) - - icon_fname_large = str(cbook._get_data_path( - 'images/matplotlib.png')) - icon_img_large = ImageTk.PhotoImage( - file=icon_fname_large, master=window) - - window.iconphoto(False, icon_img_large, icon_img) - canvas = canvas_class(figure, master=window) manager = cls(canvas, num, window) if mpl.is_interactive(): @@ -612,6 +595,27 @@ def destroy(*args): Gcf.destroy(self) self.window.protocol("WM_DELETE_WINDOW", destroy) self.window.deiconify() + + # Put a Matplotlib icon on the window rather than the default tk + # icon. See https://www.tcl.tk/man/tcl/TkCmd/wm.html#M50 + # + # The icon is set after calling deiconify() to avoid a bug when + # running IPython on Windows. + # + # `ImageTk` can be replaced with `tk` whenever the minimum + # supported Tk version is increased to 8.6, as Tk 8.6+ natively + # supports PNG images. + icon_fname = str(cbook._get_data_path( + 'images/matplotlib_small.png')) + icon_img = ImageTk.PhotoImage(file=icon_fname, master=self.window) + + icon_fname_large = str(cbook._get_data_path( + 'images/matplotlib.png')) + icon_img_large = ImageTk.PhotoImage( + file=icon_fname_large, master=self.window) + + self.window.iconphoto(False, icon_img_large, icon_img) + self.canvas._tkcanvas.focus_set() else: self.canvas.draw_idle() From 8e45609aeb0263ab74f8b842584d7fcf3fc230f8 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Thu, 17 Sep 2026 09:01:44 -0600 Subject: [PATCH 027/210] TST: Collect coverage from subprocesses --- .coveragerc | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index f8d90f93e600..00059575f610 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,6 @@ [run] branch = true +patch = subprocess source = matplotlib mpl_toolkits diff --git a/pyproject.toml b/pyproject.toml index 9496952eea6a..2ae32a02fbd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,7 +127,7 @@ doc = [ test = [ "black<27", "certifi", - "coverage!=6.3", + "coverage>=7.10", "psutil; sys_platform != 'cygwin'", "pytest!=4.6.0,!=5.4.0,!=8.1.0", "pytest-cov", From 3ad2fe87b4c4082f7a6e7aa7ec7ed8a881a4960e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2026 19:16:26 +0000 Subject: [PATCH 028/210] Bump the actions group with 4 updates Bumps the actions group with 4 updates: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel), [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action). Updates `pypa/cibuildwheel` from 4.2.0 to 4.2.1 - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/1828c10ab37f080699c7b81cea34097c684a7074...e090b81e30c4d855ea63bf4b6e59204c09a101ae) Updates `github/codeql-action/init` from 4.37.9 to 4.38.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdf488f595d80d6e07e03d4674febd5ab45fa938...b96794f015dfd88f77b49b1c93e0fa7110f94c63) Updates `github/codeql-action/analyze` from 4.37.9 to 4.38.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdf488f595d80d6e07e03d4674febd5ab45fa938...b96794f015dfd88f77b49b1c93e0fa7110f94c63) Updates `zizmorcore/zizmor-action` from 0.6.3 to 0.6.4 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/70fb788f84895a7701f5643d103d587e460b5c99...cc914d7f3750a2d13d75c7f184a1060aa0e9d482) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-version: 4.2.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/codeql-action/init dependency-version: 4.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action/analyze dependency-version: 4.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/cibuildwheel.yml | 6 +++--- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/wasm.yml | 2 +- .github/workflows/zizmor.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 186e066be4b5..083a46516ab0 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -125,7 +125,7 @@ jobs: run: Remove-Item -Recurse C:\Strawberry - name: Build wheels for CPython 3.14 - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -133,7 +133,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.13 - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -141,7 +141,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.12 - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 430d0aae75c5..ea6d1941acc7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 + uses: github/codeql-action/init@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0 with: languages: ${{ matrix.language }} @@ -45,4 +45,4 @@ jobs: pip install --user -v . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9 + uses: github/codeql-action/analyze@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0 diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 4400d36f76ae..547348c1456a 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -45,7 +45,7 @@ jobs: persist-credentials: false - name: Build wheels for wasm - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 env: CIBW_SKIP: "cp315-*" CIBW_PLATFORM: "pyodide" diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 853bef83e04a..90f8ac054e74 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -27,4 +27,4 @@ jobs: persist-credentials: false - name: Run zizmor - uses: zizmorcore/zizmor-action@70fb788f84895a7701f5643d103d587e460b5c99 # v0.6.3 + uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4 From f868c655b8886eed63b2fdca619851153d25e462 Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Sat, 19 Sep 2026 16:42:34 +0530 Subject: [PATCH 029/210] update devcontainer image from universal to ubuntu universal:2 image is old, carries a lot of bloat which fills up all space on 32 GB codespace. Most of the packages it downloads are not required for Matplotlib development. --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ddec2754d03a..9c0d8b098027 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "memory": "8gb", "cpus": 4 }, - "image": "mcr.microsoft.com/devcontainers/universal:2", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/desktop-lite:1": {}, "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { From dd3a981b2adb54eb3f208461adce7b14b189525e Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Sat, 19 Sep 2026 16:44:52 +0530 Subject: [PATCH 030/210] Remove strict host requirements from devcontainer.json Right now, one has to select 4-core codespace. Removing this gives option to select either 2-core or 4-core codespace. --- .devcontainer/devcontainer.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9c0d8b098027..fc6b3b9ab674 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,8 +1,4 @@ { - "hostRequirements": { - "memory": "8gb", - "cpus": 4 - }, "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/desktop-lite:1": {}, From e517c17d186e10ef06bacdce218a3ae7d7bceace Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Sat, 19 Sep 2026 16:48:35 +0530 Subject: [PATCH 031/210] Explicitly invoke bash to run startup script Without this, it can cause permission issues when creating a codespace. --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fc6b3b9ab674..ca41d21922da 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "packages": "inkscape,ffmpeg,dvipng,lmodern,cm-super,texlive-latex-base,texlive-latex-extra,texlive-fonts-recommended,texlive-latex-recommended,texlive-pictures,texlive-xetex,fonts-wqy-zenhei,graphviz,fonts-crosextra-carlito,fonts-freefont-otf,fonts-comic-neue,fonts-noto-cjk,optipng" } }, - "onCreateCommand": ".devcontainer/setup.sh", + "onCreateCommand": "bash .devcontainer/setup.sh", "postCreateCommand": "", "forwardPorts": [6080], "portsAttributes": { From d35f095add92227916dc60d9b72baaff700f5d3c Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Sat, 19 Sep 2026 16:52:56 +0530 Subject: [PATCH 032/210] Add SSH feature to devcontainer.json This allows codespace to be used via SSH --- .devcontainer/devcontainer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ca41d21922da..150299d5fca7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,9 @@ { "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { + "ghcr.io/devcontainers/features/sshd:1": { + "version": "latest" + }, "ghcr.io/devcontainers/features/desktop-lite:1": {}, "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { "packages": "inkscape,ffmpeg,dvipng,lmodern,cm-super,texlive-latex-base,texlive-latex-extra,texlive-fonts-recommended,texlive-latex-recommended,texlive-pictures,texlive-xetex,fonts-wqy-zenhei,graphviz,fonts-crosextra-carlito,fonts-freefont-otf,fonts-comic-neue,fonts-noto-cjk,optipng" From 435045b5cee7d56ec48666f6a0855360d403014b Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Sat, 19 Sep 2026 16:55:48 +0530 Subject: [PATCH 033/210] Add conda feature to devcontainer.json This will be required to create conda environment in setup.sh --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 150299d5fca7..2761017f6c5d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,8 @@ "ghcr.io/devcontainers/features/desktop-lite:1": {}, "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { "packages": "inkscape,ffmpeg,dvipng,lmodern,cm-super,texlive-latex-base,texlive-latex-extra,texlive-fonts-recommended,texlive-latex-recommended,texlive-pictures,texlive-xetex,fonts-wqy-zenhei,graphviz,fonts-crosextra-carlito,fonts-freefont-otf,fonts-comic-neue,fonts-noto-cjk,optipng" - } + }, + "ghcr.io/devcontainers/features/conda:1": {} }, "onCreateCommand": "bash .devcontainer/setup.sh", "postCreateCommand": "", From e3af723ee8c71c7d978364ea65bce0db343750d9 Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Sat, 19 Sep 2026 17:00:07 +0530 Subject: [PATCH 034/210] Update conda configuration path in setup in setup.sh The universal image used /home/codespace This ubuntu image uses /home/vscode We can generalize this by using $HOME and, ubuntu image has .condarc file at home location (~) --- .devcontainer/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 88da5baf69e2..48ec0933bef1 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -10,4 +10,4 @@ micromamba env create -f environment.yml --yes # Note that `micromamba activate mpl-dev` doesn't work, it must be run by the # user (same applies to `conda activate`) echo "envs_dirs: - - /home/codespace/micromamba/envs" > /opt/conda/.condarc + - $HOME/micromamba/envs" > ~/.condarc From 95219c03c6c54bf68b06079ebfad75a353fbc2bd Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Sat, 19 Sep 2026 09:56:02 -0700 Subject: [PATCH 035/210] Load AppKit before calling into CoreText --- src/_c_internal_utils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_c_internal_utils.cpp b/src/_c_internal_utils.cpp index ff9dc4fcc52b..33b5f981d454 100644 --- a/src/_c_internal_utils.cpp +++ b/src/_c_internal_utils.cpp @@ -29,6 +29,7 @@ #define UNUSED_ON_NON_WINDOWS Py_UNUSED #endif #ifdef __APPLE__ +#include #include #include #endif @@ -105,6 +106,10 @@ mpl_get_available_fonts(void) #if defined(__APPLE__) py::set fonts; + // Using CoreText before AppKit is loaded exposes a bug in NSFont<->CTFont + // toll-free bridging. Load AppKit now to avoid a future exception. + dlopen("/System/Library/Frameworks/AppKit.framework/AppKit", RTLD_NOW); + auto cfStringToPyStr = [](CFStringRef str) -> py::str { auto cstr = CFStringGetCStringPtr(str, kCFStringEncodingUTF8); if (cstr) { From 9fd55046af4059a5ae240a371abcfc93cd5f62fd Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Sat, 19 Sep 2026 11:25:09 -0700 Subject: [PATCH 036/210] Collect and upload user crash logs on failure --- .github/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf75c80ddae0..442b9be3d3bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -378,6 +378,20 @@ jobs: xcrun llvm-cov export -format="lcov" build/*/src/*.so \ -instr-profile default.profdata > info.lcov fi + + - name: Collect macOS crash logs + if: failure() && runner.os == 'macOS' + run: | + mkdir -p ./macos_crash_logs + cp -R "$HOME/Library/Logs/DiagnosticReports/" ./macos_crash_logs/ 2>/dev/null + + - name: Upload macOS crash logs + if: failure() && runner.os == 'macOS' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: macos-crash-logs + path: ./macos_crash_logs + - name: Upload code coverage if: ${{ !cancelled() && github.event_name != 'schedule' }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 From ed1cc204301d89bd1fc3cd70293d479a412b1e9a Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Fri, 24 Jul 2026 20:34:22 -0600 Subject: [PATCH 037/210] PERF: Cut per-glyph overhead in the Agg text renderer --- lib/matplotlib/backends/backend_agg.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index 77aa54375ae9..5500e80c3672 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -193,20 +193,27 @@ def _draw_text_glyphs_and_boxes(self, gc, x, y, angle, glyphs, boxes): cos = math.cos(math.radians(angle)) sin = math.sin(math.radians(angle)) load_flags = get_hinting_flag() + antialiased = gc.get_antialiased() + render_mode = RenderMode.NORMAL if antialiased else RenderMode.MONO + sized = None for font, size, glyph_index, slant, extend, dx, dy in glyphs: # dy is upwards. - font.set_size(size, self.dpi) + if sized != (font, size): + # set_size recurses into the fallbacks, so only call it on a change. + font.set_size(size, self.dpi) + sized = (font, size) font._set_transform( - (0x10000 * np.array([[cos, -sin], [sin, cos]]) - @ [[extend, extend * slant], [0, 1]]).round().astype(int), + # 0x10000 * rotation @ [[extend, extend * slant], [0, 1]]. + [[round(0x10000 * extend * cos), + round(0x10000 * (extend * slant * cos - sin))], + [round(0x10000 * extend * sin), + round(0x10000 * (extend * slant * sin + cos))]], [round(0x40 * (x + dx * cos - dy * sin)), # FreeType's y is upwards. round(0x40 * (self.height - y + dx * sin + dy * cos))] ) - bitmap = font._render_glyph( - glyph_index, load_flags, - RenderMode.NORMAL if gc.get_antialiased() else RenderMode.MONO) + bitmap = font._render_glyph(glyph_index, load_flags, render_mode) buffer = bitmap.buffer - if not gc.get_antialiased(): + if not antialiased: buffer *= 0xff # draw_text_image's y is downwards & the bitmap bottom side. self._renderer.draw_text_image( From 7ee7bec77e2d3b43da309bdfcaf9e2e0d9358e56 Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Fri, 24 Jul 2026 20:37:58 -0600 Subject: [PATCH 038/210] PERF: Cache loaded glyph outlines in FT2Font --- lib/matplotlib/tests/test_ft2font.py | 25 ++++++++ src/ft2font.cpp | 94 +++++++++++++++++++++++++--- src/ft2font.h | 15 +++++ src/ft2font_wrapper.cpp | 11 ++-- 4 files changed, 132 insertions(+), 13 deletions(-) diff --git a/lib/matplotlib/tests/test_ft2font.py b/lib/matplotlib/tests/test_ft2font.py index 82cedfbac855..1361b3075774 100644 --- a/lib/matplotlib/tests/test_ft2font.py +++ b/lib/matplotlib/tests/test_ft2font.py @@ -1075,3 +1075,28 @@ def test__layout(): assert Path(item.ft_object.fname).name == 'DejaVuSans.ttf' else: assert Path(item.ft_object.fname).name == 'cmr10.ttf' + + +def test_render_glyph_cache(): + # Reusing a cached outline must not change what is rendered. + ft = fm.get_font(fm.findfont('DejaVu Sans')) + ft.set_size(12, 100) + index = ft.get_char_index(ord('e')) + identity = [[0x10000, 0], [0, 0x10000]] + + def render(delta=(0, 0)): + ft._set_transform(identity, list(delta)) + return ft._render_glyph(index, ft2font.LoadFlags.DEFAULT, + ft2font.RenderMode.NORMAL) + + first = render() + reference = first.buffer.copy() + # A whole-pixel shift reuses the outline and only moves the glyph. + shifted = render(delta=(0x40 * 3, 0x40 * 5)) + assert np.array_equal(shifted.buffer, reference) + assert (shifted.left, shifted.top) == (first.left + 3, first.top + 5) + # A fractional shift must reach the rasterizer rather than be rounded away. + assert not np.array_equal(render(delta=(0x20, 0x20)).buffer, reference) + # The size is part of the key. + ft.set_size(24, 100) + assert render().buffer.shape != reference.shape diff --git a/src/ft2font.cpp b/src/ft2font.cpp index d78bbc42acd4..0218efefeb79 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -181,7 +181,9 @@ FT2Font::get_path(std::vector &vertices, std::vector &cod } FT2Font::FT2Font(std::vector &fallback_list, bool warn_if_used) - : warn_if_used(warn_if_used), image({1, 1}), face(nullptr), fallbacks(fallback_list), + : warn_if_used(warn_if_used), image({1, 1}), face(nullptr), + char_size(0), char_dpi(0), glyph_matrix{0x10000, 0, 0, 0x10000}, glyph_delta{0, 0}, + fallbacks(fallback_list), // set default kerning factor to 0, i.e., no kerning manipulation kerning_factor(0) { @@ -216,6 +218,7 @@ void FT2Font::close() FT_Done_Glyph(glyph); } glyphs.clear(); + clear_glyph_cache(); if (face) { FT_Done_Face(face); @@ -223,6 +226,14 @@ void FT2Font::close() } } +void FT2Font::clear_glyph_cache() +{ + for (auto & [key, glyph] : glyph_cache) { + FT_Done_Glyph(glyph); + } + glyph_cache.clear(); +} + void FT2Font::clear() { pen.x = pen.y = 0; @@ -243,11 +254,12 @@ void FT2Font::clear() void FT2Font::set_size(double ptsize, double dpi) { - FT_CHECK( - FT_Set_Char_Size, - face, (FT_F26Dot6)(ptsize * 64), 0, (FT_UInt)dpi, (FT_UInt)dpi); - FT_Matrix transform = { 65536, 0, 0, 65536 }; - FT_Set_Transform(face, &transform, nullptr); + char_size = (FT_F26Dot6)(ptsize * 64); + char_dpi = (FT_UInt)dpi; + FT_CHECK(FT_Set_Char_Size, face, char_size, 0, char_dpi, char_dpi); + glyph_matrix = { 65536, 0, 0, 65536 }; + glyph_delta = { 0, 0 }; + FT_Set_Transform(face, &glyph_matrix, nullptr); for (auto & fallback : fallbacks) { fallback->set_size(ptsize, dpi); @@ -257,9 +269,9 @@ void FT2Font::set_size(double ptsize, double dpi) void FT2Font::_set_transform( std::array, 2> matrix, std::array delta) { - FT_Matrix m = {matrix[0][0], matrix[0][1], matrix[1][0], matrix[1][1]}; - FT_Vector d = {delta[0], delta[1]}; - FT_Set_Transform(face, &m, &d); + glyph_matrix = {matrix[0][0], matrix[0][1], matrix[1][0], matrix[1][1]}; + glyph_delta = {delta[0], delta[1]}; + FT_Set_Transform(face, &glyph_matrix, &glyph_delta); for (auto & fallback : fallbacks) { fallback->_set_transform(matrix, delta); } @@ -647,6 +659,70 @@ void FT2Font::load_glyph(FT_UInt glyph_index, FT_Int32 flags) glyphs.push_back(thisGlyph); } +FT_Glyph FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) +{ + // FreeType hints before transforming, so an outline loaded under a given + // matrix can be reused at every position, translating it when rasterizing. + auto const& key = GlyphCacheKey{ + glyph_index, flags, char_size, char_dpi, + glyph_matrix.xx, glyph_matrix.xy, glyph_matrix.yx, glyph_matrix.yy}; + if (auto const& cached = glyph_cache.find(key); cached != glyph_cache.end()) { + return cached->second; + } + + // Load without the translation, so the outline sits at the origin. The + // face transform is restored either way, as other methods load through it. + FT_Set_Transform(face, &glyph_matrix, nullptr); + auto const& load_error = FT_Load_Glyph(face, glyph_index, flags); + if (load_error) { + FT_Set_Transform(face, &glyph_matrix, &glyph_delta); + THROW_FT_ERROR("FT_Load_Glyph", load_error); + } + if (face->glyph->format != FT_GLYPH_FORMAT_OUTLINE) { + // Only outlines can be repositioned after loading. A null glyph + // records that, and the caller loads these itself. + FT_Set_Transform(face, &glyph_matrix, &glyph_delta); + if (glyph_cache.size() >= glyph_cache_max) { + clear_glyph_cache(); + } + return glyph_cache[key] = nullptr; + } + FT_Glyph glyph = nullptr; + auto const& glyph_error = FT_Get_Glyph(face->glyph, &glyph); + FT_Set_Transform(face, &glyph_matrix, &glyph_delta); + if (glyph_error) { + THROW_FT_ERROR("FT_Get_Glyph", glyph_error); + } + auto owned = std::unique_ptr, decltype(&FT_Done_Glyph)>{ + glyph, &FT_Done_Glyph}; + + if (glyph_cache.size() >= glyph_cache_max) { + clear_glyph_cache(); + } + glyph_cache[key] = glyph; + owned.release(); // The cache owns it now. + return glyph; +} + +FT_Glyph FT2Font::render_glyph( + FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode) +{ + auto const& cached = cache_glyph(glyph_index, flags); + if (!cached) { // Not an outline, so load and rasterize it directly. + FT_CHECK(FT_Load_Glyph, face, glyph_index, flags); + FT_CHECK(FT_Render_Glyph, face->glyph, render_mode); + FT_Glyph glyph = nullptr; + FT_CHECK(FT_Get_Glyph, face->glyph, &glyph); + return glyph; + } + + // With `destroy` false this translates the cached outline, rasterizes it, + // and translates it back. + FT_Glyph glyph = cached; + FT_CHECK(FT_Glyph_To_Bitmap, &glyph, render_mode, &glyph_delta, false); + return glyph; +} + FT_UInt FT2Font::get_char_index(FT_ULong charcode, bool fallback = false) { FT2Font *ft_object = nullptr; diff --git a/src/ft2font.h b/src/ft2font.h index 383dc0915bbc..3d859a56d679 100644 --- a/src/ft2font.h +++ b/src/ft2font.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -133,6 +134,7 @@ class FT2Font FT_Error &glyph_error, std::set &glyph_seen_fonts); void load_glyph(FT_UInt glyph_index, FT_Int32 flags); + FT_Glyph render_glyph(FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode); std::tuple get_width_height(); std::tuple get_bitmap_offset(); long get_descent(); @@ -179,11 +181,24 @@ class FT2Font protected: virtual void ft_glyph_warn(FT_ULong charcode, std::set family_names) = 0; private: + // Everything affecting a loaded outline, but not the translation, which is + // applied when rasterizing. + using GlyphCacheKey = std::tuple; + static constexpr size_t glyph_cache_max = 1024; + FT_Glyph cache_glyph(FT_UInt glyph_index, FT_Int32 flags); + void clear_glyph_cache(); + bool warn_if_used; py::array_t image; FT_Face face; FT_Vector pen; /* untransformed origin */ std::vector glyphs; + std::map glyph_cache; + FT_F26Dot6 char_size; + FT_UInt char_dpi; + FT_Matrix glyph_matrix; + FT_Vector glyph_delta; std::vector fallbacks; std::unordered_map char_to_font; FT_BBox bbox; diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index ebc65f188a73..4b6297fdf69e 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -1785,10 +1785,13 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used()) [ft2Library](PyFT2Font *self, FT_UInt idx, LoadFlags flags, FT_Render_Mode render_mode) { - auto face = self->get_face(); - FT_CHECK(FT_Load_Glyph, face, idx, static_cast(flags)); - FT_CHECK(FT_Render_Glyph, face->glyph, render_mode); - return PyPositionedBitmap{ft2Library, face->glyph}; + auto const& glyph = + std::unique_ptr, + decltype(&FT_Done_Glyph)>( + self->render_glyph(idx, static_cast(flags), render_mode), + &FT_Done_Glyph); + return PyPositionedBitmap{ + ft2Library, reinterpret_cast(glyph.get())}; }) ; From d5ad4d726caf1a352bf7d9914af5aed3d5009040 Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Fri, 24 Jul 2026 20:41:47 -0600 Subject: [PATCH 039/210] PERF: Cache shaped text layouts in FT2Font --- lib/matplotlib/tests/test_ft2font.py | 47 ++++++++++++++++++++++++++++ src/ft2font.cpp | 41 ++++++++++++++++++++++-- src/ft2font.h | 18 +++++++++++ 3 files changed, 103 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_ft2font.py b/lib/matplotlib/tests/test_ft2font.py index 1361b3075774..ab389038ab9a 100644 --- a/lib/matplotlib/tests/test_ft2font.py +++ b/lib/matplotlib/tests/test_ft2font.py @@ -1100,3 +1100,50 @@ def render(delta=(0, 0)): # The size is part of the key. ft.set_size(24, 100) assert render().buffer.shape != reference.shape + + +def test_layout_cache(): + # A cached layout must match a fresh one, and the size is part of the key. + ft = fm.get_font(fm.findfont('DejaVu Sans')) + ft.set_size(12, 100) + + def xs(): + return [item.x for item in ft._layout('hello world', + ft2font.LoadFlags.DEFAULT)] + + first = xs() + assert xs() == first + ft.set_size(24, 100) + assert xs() != first + + +def test_layout_cache_transform(): + # The transform is part of the key, as it changes the shaped positions. + ft = fm.get_font(fm.findfont('DejaVu Sans')) + ft.set_size(12, 100) + + def xs(): + return [item.x for item in ft._layout('hello world', + ft2font.LoadFlags.DEFAULT)] + + first = xs() + ft._set_transform([[0x20000, 0], [0, 0x10000]], [0, 0]) + assert xs() != first + + +def test_layout_cache_fallback_size(): + # Shaping reads the fallback faces, so resizing one must invalidate the cache. + ft = fm.get_font(fm.fontManager._find_fonts_by_props( + fm.FontProperties(family=['cmr10', 'DejaVu Sans']))) + ft.set_size(12, 100) + + def items(): + return ft._layout('AV \N{CIRCLED LATIN CAPITAL LETTER A} ffi', + ft2font.LoadFlags.DEFAULT) + + first = [item.x for item in items()] + for item in items(): + if item.ft_object is not ft: + item.ft_object.set_size(40, 100) + break + assert [item.x for item in items()] != first diff --git a/src/ft2font.cpp b/src/ft2font.cpp index 0218efefeb79..ef1b3a26b471 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -183,6 +183,7 @@ FT2Font::get_path(std::vector &vertices, std::vector &cod FT2Font::FT2Font(std::vector &fallback_list, bool warn_if_used) : warn_if_used(warn_if_used), image({1, 1}), face(nullptr), char_size(0), char_dpi(0), glyph_matrix{0x10000, 0, 0, 0x10000}, glyph_delta{0, 0}, + charmap_generation(0), fallbacks(fallback_list), // set default kerning factor to 0, i.e., no kerning manipulation kerning_factor(0) @@ -219,6 +220,7 @@ void FT2Font::close() } glyphs.clear(); clear_glyph_cache(); + layout_cache.clear(); if (face) { FT_Done_Face(face); @@ -283,11 +285,24 @@ void FT2Font::set_charmap(int i) throw std::runtime_error("i exceeds the available number of char maps"); } FT_CHECK(FT_Set_Charmap, face, face->charmaps[i]); + charmap_generation++; } void FT2Font::select_charmap(unsigned long i) { FT_CHECK(FT_Select_Charmap, face, (FT_Encoding)i); + charmap_generation++; +} + +std::vector FT2Font::shaping_state() const +{ + // Shaping reads the fallback faces too, so their state is part of the key. + std::vector state{{char_size, char_dpi, charmap_generation}}; + for (auto const& fallback : fallbacks) { + auto const& nested = fallback->shaping_state(); + state.insert(state.end(), nested.begin(), nested.end()); + } + return state; } int FT2Font::get_kerning(FT_UInt left, FT_UInt right, FT_Kerning_Mode mode) @@ -319,6 +334,17 @@ std::vector FT2Font::layout( { clear(); + auto const& key = LayoutCacheKey{ + std::u32string{text}, flags, features, languages, shaping_state(), + glyph_matrix.xx, glyph_matrix.xy, glyph_matrix.yx, glyph_matrix.yy}; + if (auto const& cached = layout_cache.find(key); cached != layout_cache.end()) { + auto const& entry = cached->second; + glyph_seen_fonts.insert(entry.seen_fonts.begin(), entry.seen_fonts.end()); + return entry.glyphs; + } + // Kept apart from the caller's set so that it can be replayed from the cache. + std::set seen_fonts; + auto rq = raqm_create(); if (!rq) { throw std::runtime_error("failed to compute text layout"); @@ -360,7 +386,7 @@ std::vector FT2Font::layout( } std::vector> face_substitutions; - glyph_seen_fonts.insert(face->family_name); + seen_fonts.insert(face->family_name); // Attempt to use fallback fonts if necessary. for (auto const& fallback : fallbacks) { @@ -399,7 +425,7 @@ std::vector FT2Font::layout( // If a fallback was used, then re-attempt the layout with the new fonts. if (!fallback->warn_if_used) { - glyph_seen_fonts.insert(fallback->face->family_name); + seen_fonts.insert(fallback->face->family_name); } raqm_clear_contents(rq); @@ -444,7 +470,16 @@ std::vector FT2Font::layout( size_t num_glyphs = 0; auto const& rq_glyphs = raqm_get_glyphs(rq, &num_glyphs); - return std::vector(rq_glyphs, rq_glyphs + num_glyphs); + if (layout_cache.size() >= layout_cache_max) { + layout_cache.clear(); + } + auto const& entry = layout_cache.insert_or_assign( + key, + LayoutCacheEntry{ + std::vector(rq_glyphs, rq_glyphs + num_glyphs), + std::move(seen_fonts)}).first->second; + glyph_seen_fonts.insert(entry.seen_fonts.begin(), entry.seen_fonts.end()); + return entry.glyphs; } void FT2Font::set_text( diff --git a/src/ft2font.h b/src/ft2font.h index 3d859a56d679..655ac0714873 100644 --- a/src/ft2font.h +++ b/src/ft2font.h @@ -189,6 +189,23 @@ class FT2Font FT_Glyph cache_glyph(FT_UInt glyph_index, FT_Int32 flags); void clear_glyph_cache(); + // The size and charmap of one face. The charmap is a counter, as FreeType + // offers no cheap way to identify the selected one. + using FaceState = std::tuple; + std::vector shaping_state() const; + + // Everything that affects the shaped output of layout(). + using LayoutCacheKey = std::tuple>, + LanguageType, std::vector, + FT_Fixed, FT_Fixed, FT_Fixed, FT_Fixed>; + struct LayoutCacheEntry { + std::vector glyphs; + std::set seen_fonts; + }; + static constexpr size_t layout_cache_max = 1024; + std::map layout_cache; + bool warn_if_used; py::array_t image; FT_Face face; @@ -199,6 +216,7 @@ class FT2Font FT_UInt char_dpi; FT_Matrix glyph_matrix; FT_Vector glyph_delta; + unsigned long charmap_generation; std::vector fallbacks; std::unordered_map char_to_font; FT_BBox bbox; From 8748c98b59d5e8d57e42b4cd42e80a5685e161fd Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Sat, 25 Jul 2026 09:34:48 -0600 Subject: [PATCH 040/210] PERF: Reuse cached glyph outlines when laying out and measuring text --- src/ft2font.cpp | 64 +++++++++++++++++++++++++++++------------ src/ft2font.h | 11 +++++-- src/ft2font_wrapper.cpp | 7 +++-- 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index ef1b3a26b471..aefa97d1e647 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -230,8 +230,8 @@ void FT2Font::close() void FT2Font::clear_glyph_cache() { - for (auto & [key, glyph] : glyph_cache) { - FT_Done_Glyph(glyph); + for (auto & [key, cached] : glyph_cache) { + FT_Done_Glyph(cached.glyph); } glyph_cache.clear(); } @@ -518,16 +518,7 @@ void FT2Font::set_text( } // extract glyph image and store it in our table - FT_Error error; - error = FT_Load_Glyph(rglyph.ftface, rglyph.index, flags); - if (error) { - throw std::runtime_error("failed to load glyph"); - } - FT_Glyph thisGlyph; - error = FT_Get_Glyph(rglyph.ftface->glyph, &thisGlyph); - if (error) { - throw std::runtime_error("failed to get glyph"); - } + auto thisGlyph = wrapped_font->load_glyph_copy(rglyph.index, flags); pen.x += rglyph.x_offset; pen.y += rglyph.y_offset; @@ -694,7 +685,7 @@ void FT2Font::load_glyph(FT_UInt glyph_index, FT_Int32 flags) glyphs.push_back(thisGlyph); } -FT_Glyph FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) +FT2Font::CachedGlyph const *FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) { // FreeType hints before transforming, so an outline loaded under a given // matrix can be reused at every position, translating it when rasterizing. @@ -702,7 +693,7 @@ FT_Glyph FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) glyph_index, flags, char_size, char_dpi, glyph_matrix.xx, glyph_matrix.xy, glyph_matrix.yx, glyph_matrix.yy}; if (auto const& cached = glyph_cache.find(key); cached != glyph_cache.end()) { - return cached->second; + return &cached->second; } // Load without the translation, so the outline sits at the origin. The @@ -716,14 +707,17 @@ FT_Glyph FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) if (face->glyph->format != FT_GLYPH_FORMAT_OUTLINE) { // Only outlines can be repositioned after loading. A null glyph // records that, and the caller loads these itself. + auto const linear_hori_advance = face->glyph->linearHoriAdvance; FT_Set_Transform(face, &glyph_matrix, &glyph_delta); if (glyph_cache.size() >= glyph_cache_max) { clear_glyph_cache(); } - return glyph_cache[key] = nullptr; + return &(glyph_cache[key] = CachedGlyph{nullptr, linear_hori_advance}); } FT_Glyph glyph = nullptr; auto const& glyph_error = FT_Get_Glyph(face->glyph, &glyph); + // Copied out of the glyph slot, which the next load overwrites. + auto const linear_hori_advance = face->glyph->linearHoriAdvance; FT_Set_Transform(face, &glyph_matrix, &glyph_delta); if (glyph_error) { THROW_FT_ERROR("FT_Get_Glyph", glyph_error); @@ -734,16 +728,48 @@ FT_Glyph FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) if (glyph_cache.size() >= glyph_cache_max) { clear_glyph_cache(); } - glyph_cache[key] = glyph; + auto const& entry = &(glyph_cache[key] = CachedGlyph{glyph, linear_hori_advance}); owned.release(); // The cache owns it now. - return glyph; + return entry; +} + +FT_Glyph FT2Font::load_glyph_copy( + FT_UInt glyph_index, FT_Int32 flags, FT_Fixed *linear_hori_advance) +{ + auto const& cached = cache_glyph(glyph_index, flags); + FT_Glyph glyph = nullptr; + if (cached->glyph) { + FT_CHECK(FT_Glyph_Copy, cached->glyph, &glyph); + } else { // Not an outline, so load it the slow way. + FT_CHECK(FT_Load_Glyph, face, glyph_index, flags); + FT_CHECK(FT_Get_Glyph, face->glyph, &glyph); + } + auto owned = std::unique_ptr, decltype(&FT_Done_Glyph)>{ + glyph, &FT_Done_Glyph}; + if (cached->glyph && (glyph_delta.x || glyph_delta.y)) { + FT_CHECK(FT_Glyph_Transform, glyph, nullptr, &glyph_delta); + } + if (linear_hori_advance) { + *linear_hori_advance = cached->linear_hori_advance; + } + return owned.release(); +} + +FT_Fixed FT2Font::load_glyph_cached(FT_UInt glyph_index, FT_Int32 flags) +{ + FT_Fixed linear_hori_advance = 0; + auto owned = std::unique_ptr, decltype(&FT_Done_Glyph)>{ + load_glyph_copy(glyph_index, flags, &linear_hori_advance), &FT_Done_Glyph}; + glyphs.push_back(owned.get()); + owned.release(); // `glyphs` owns it now. + return linear_hori_advance; } FT_Glyph FT2Font::render_glyph( FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode) { auto const& cached = cache_glyph(glyph_index, flags); - if (!cached) { // Not an outline, so load and rasterize it directly. + if (!cached->glyph) { // Not an outline, so load and rasterize it directly. FT_CHECK(FT_Load_Glyph, face, glyph_index, flags); FT_CHECK(FT_Render_Glyph, face->glyph, render_mode); FT_Glyph glyph = nullptr; @@ -753,7 +779,7 @@ FT_Glyph FT2Font::render_glyph( // With `destroy` false this translates the cached outline, rasterizes it, // and translates it back. - FT_Glyph glyph = cached; + FT_Glyph glyph = cached->glyph; FT_CHECK(FT_Glyph_To_Bitmap, &glyph, render_mode, &glyph_delta, false); return glyph; } diff --git a/src/ft2font.h b/src/ft2font.h index 655ac0714873..d4d689998deb 100644 --- a/src/ft2font.h +++ b/src/ft2font.h @@ -134,6 +134,9 @@ class FT2Font FT_Error &glyph_error, std::set &glyph_seen_fonts); void load_glyph(FT_UInt glyph_index, FT_Int32 flags); + FT_Glyph load_glyph_copy(FT_UInt glyph_index, FT_Int32 flags, + FT_Fixed *linear_hori_advance = nullptr); + FT_Fixed load_glyph_cached(FT_UInt glyph_index, FT_Int32 flags); FT_Glyph render_glyph(FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode); std::tuple get_width_height(); std::tuple get_bitmap_offset(); @@ -186,7 +189,11 @@ class FT2Font using GlyphCacheKey = std::tuple; static constexpr size_t glyph_cache_max = 1024; - FT_Glyph cache_glyph(FT_UInt glyph_index, FT_Int32 flags); + struct CachedGlyph { + FT_Glyph glyph; + FT_Fixed linear_hori_advance; // Unaffected by the transform. + }; + CachedGlyph const *cache_glyph(FT_UInt glyph_index, FT_Int32 flags); void clear_glyph_cache(); // The size and charmap of one face. The charmap is a counter, as FreeType @@ -211,7 +218,7 @@ class FT2Font FT_Face face; FT_Vector pen; /* untransformed origin */ std::vector glyphs; - std::map glyph_cache; + std::map glyph_cache; FT_F26Dot6 char_size; FT_UInt char_dpi; FT_Matrix glyph_matrix; diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 4b6297fdf69e..10acd2653c7a 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -1406,7 +1406,9 @@ PyFT2Font_layout(PyFT2Font *self, std::u32string text, LoadFlags flags, for (auto &glyph : glyphs) { auto ft_object = static_cast(glyph.ftface->generic.data); - ft_object->load_glyph(glyph.index, load_flags); + // Note, linearHoriAdvance is a 16.16 instead of 26.6 fixed-point value. + auto const& linear_hori_advance = + ft_object->load_glyph_cached(glyph.index, load_flags) / 1024.0; double prev_kern = 0.0; if (prev_advance) { @@ -1424,8 +1426,7 @@ PyFT2Font_layout(PyFT2Font *self, std::u32string text, LoadFlags flags, prev_x = x + glyph.x_offset; x += glyph.x_advance; y += glyph.y_advance; - // Note, linearHoriAdvance is a 16.16 instead of 26.6 fixed-point value. - prev_advance = ft_object->get_face()->glyph->linearHoriAdvance / 1024.0; + prev_advance = linear_hori_advance; } return items; From f912057124b6171cd5b4b1342acc342944c97916 Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Sat, 25 Jul 2026 09:58:19 -0600 Subject: [PATCH 041/210] PERF: Only load glyphs when their outline is needed --- lib/matplotlib/_text_helpers.py | 11 ++++------- lib/matplotlib/tests/test_textpath.py | 12 +++++++++++- lib/matplotlib/textpath.py | 2 ++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/matplotlib/_text_helpers.py b/lib/matplotlib/_text_helpers.py index 0ebbf3ac139d..4d36f92ac316 100644 --- a/lib/matplotlib/_text_helpers.py +++ b/lib/matplotlib/_text_helpers.py @@ -24,8 +24,8 @@ def layout(string: str, font: FT2Font, *, """ Render *string* with *font*. - For each character in *string*, yield a LayoutItem instance. When such an instance - is yielded, the font's glyph is set to the corresponding character. + For each character in *string*, yield a LayoutItem instance. Callers that + need the outline must load the glyph themselves. Parameters ---------- @@ -43,8 +43,5 @@ def layout(string: str, font: FT2Font, *, ------ LayoutItem """ - for raqm_item in font._layout(string, LoadFlags.NO_HINTING, - features=features, language=language): - raqm_item.ft_object.load_glyph(raqm_item.glyph_index, - flags=LoadFlags.NO_HINTING) - yield raqm_item + yield from font._layout(string, LoadFlags.NO_HINTING, + features=features, language=language) diff --git a/lib/matplotlib/tests/test_textpath.py b/lib/matplotlib/tests/test_textpath.py index e421d2623cad..900b4a23f5f5 100644 --- a/lib/matplotlib/tests/test_textpath.py +++ b/lib/matplotlib/tests/test_textpath.py @@ -1,6 +1,16 @@ import copy -from matplotlib.textpath import TextPath +import matplotlib.font_manager as fm +from matplotlib.textpath import TextPath, TextToPath + + +def test_glyphs_load_their_own_outline(): + # Laying out no longer leaves a glyph in the font's slot, so each outline + # must be loaded where it is read, not taken from whatever was there. + font = fm.get_font(fm.findfont('DejaVu Sans')) + _, glyph_map, _ = TextToPath().get_glyphs_with_font(font, 'lM') + (l_verts, _), (m_verts, _) = glyph_map.values() + assert len(l_verts) != len(m_verts) def test_copy(): diff --git a/lib/matplotlib/textpath.py b/lib/matplotlib/textpath.py index d7c1cdf1622f..1c32ba9a0e6b 100644 --- a/lib/matplotlib/textpath.py +++ b/lib/matplotlib/textpath.py @@ -155,6 +155,8 @@ def get_glyphs_with_font(self, font, s, glyph_map=None, xpositions.append(item.x) ypositions.append(item.y) if glyph_repr not in glyph_map: + item.ft_object.load_glyph(item.glyph_index, + flags=LoadFlags.NO_HINTING) glyph_map_new[glyph_repr] = item.ft_object.get_path() sizes = [1.] * len(xpositions) From 150808e89c507507fd2246679ad462a8b24f6845 Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Fri, 24 Jul 2026 20:48:52 -0600 Subject: [PATCH 042/210] PERF: Draw a run of glyphs in one call rather than one per glyph --- lib/matplotlib/backends/backend_agg.py | 35 +------ lib/matplotlib/tests/test_agg.py | 20 ++++ src/_backend_agg.h | 92 ++++++++++++++---- src/_backend_agg_wrapper.cpp | 32 +++++++ src/ft2font_wrapper.cpp | 128 +++++++++++++++++++++++++ 5 files changed, 256 insertions(+), 51 deletions(-) diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index 5500e80c3672..337014ad07a3 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -36,7 +36,7 @@ _Backend, FigureCanvasBase, FigureManagerBase, GraphicsContextBase, RendererBase) from matplotlib.dviread import Dvi from matplotlib.font_manager import fontManager as _fontManager, get_font -from matplotlib.ft2font import LoadFlags, RenderMode +from matplotlib.ft2font import LoadFlags, RenderMode, _render_glyph_run from matplotlib.mathtext import MathTextParser from matplotlib.path import Path from matplotlib.transforms import Bbox, BboxBase @@ -190,36 +190,11 @@ def draw_path(self, gc, path, transform, rgbFace=None): def _draw_text_glyphs_and_boxes(self, gc, x, y, angle, glyphs, boxes): # y is downwards. - cos = math.cos(math.radians(angle)) - sin = math.sin(math.radians(angle)) - load_flags = get_hinting_flag() antialiased = gc.get_antialiased() - render_mode = RenderMode.NORMAL if antialiased else RenderMode.MONO - sized = None - for font, size, glyph_index, slant, extend, dx, dy in glyphs: # dy is upwards. - if sized != (font, size): - # set_size recurses into the fallbacks, so only call it on a change. - font.set_size(size, self.dpi) - sized = (font, size) - font._set_transform( - # 0x10000 * rotation @ [[extend, extend * slant], [0, 1]]. - [[round(0x10000 * extend * cos), - round(0x10000 * (extend * slant * cos - sin))], - [round(0x10000 * extend * sin), - round(0x10000 * (extend * slant * sin + cos))]], - [round(0x40 * (x + dx * cos - dy * sin)), - # FreeType's y is upwards. - round(0x40 * (self.height - y + dx * sin + dy * cos))] - ) - bitmap = font._render_glyph(glyph_index, load_flags, render_mode) - buffer = bitmap.buffer - if not antialiased: - buffer *= 0xff - # draw_text_image's y is downwards & the bitmap bottom side. - self._renderer.draw_text_image( - buffer, - bitmap.left, int(self.height) - bitmap.top + buffer.shape[0], - 0, gc) + buffer, positions = _render_glyph_run( + list(glyphs), self.dpi, x, y, angle, self.height, get_hinting_flag(), + RenderMode.NORMAL if antialiased else RenderMode.MONO) + self._renderer.draw_text_images(buffer, positions, gc) rgba = gc.get_rgb() if len(rgba) == 3 or gc.get_forced_alpha(): diff --git a/lib/matplotlib/tests/test_agg.py b/lib/matplotlib/tests/test_agg.py index b7781ff11411..f9e3175f6f17 100644 --- a/lib/matplotlib/tests/test_agg.py +++ b/lib/matplotlib/tests/test_agg.py @@ -432,3 +432,23 @@ def test_path_autosnap(fig_test, fig_ref): axt.autoscale_view() axr.autoscale_view() + + +def test_draw_text_images_bounds(): + # Positions must describe bitmaps inside the buffer, as the renderer indexes + # into it without checking. + fig = plt.figure(figsize=(1, 1), dpi=40) + fig.canvas.draw() + renderer = fig.canvas.get_renderer() + gc = renderer.new_gc() + buffer = np.zeros(16, dtype=np.uint8) + + for positions in [[[1 << 20, 4, 4, 5, 20]], # Offset past the end. + [[0, 400, 400, 5, 39]], # Larger than the buffer. + [[0, -4, 4, 5, 20]]]: # Negative size. + with pytest.raises(ValueError, match='outside of buffer'): + renderer._renderer.draw_text_images( + buffer, np.array(positions, dtype=np.intp), gc) + + renderer._renderer.draw_text_images( + buffer, np.array([[0, 2, 2, 1, 3]], dtype=np.intp), gc) diff --git a/src/_backend_agg.h b/src/_backend_agg.h index 78b4b2fdfc2e..99ccac555347 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -152,6 +152,9 @@ class RendererAgg template void draw_text_image(GCAgg &gc, ImageArray &image, int x, int y, double angle); + template + void draw_text_images(GCAgg &gc, BufferArray &buffer, PositionArray &positions); + template void draw_image(GCAgg &gc, double x, @@ -243,6 +246,11 @@ class RendererAgg template void set_clipbox(const agg::rect_d &cliprect, R &rasterizer); + std::optional text_clip_rect(const agg::rect_d &cliprect); + + void blend_text_bitmap(GCAgg &gc, const agg::int8u *covers, int rows, int cols, + int x, int y, const std::optional &clip); + bool render_clippath(mpl::PathIterator &clippath, const agg::trans_affine &clippath_trans, e_snap_mode snap_mode); template @@ -688,6 +696,42 @@ class font_to_rgba } }; +// An unset cliprect is all zeros, and clips nothing. +inline std::optional RendererAgg::text_clip_rect(const agg::rect_d &cliprect) +{ + if (cliprect.x1 == 0.0 && cliprect.y1 == 0.0 && + cliprect.x2 == 0.0 && cliprect.y2 == 0.0) { + return std::nullopt; + } + agg::rect_i clip; + clip.init(mpl_round_to_int(cliprect.x1), mpl_round_to_int(height - cliprect.y2), + mpl_round_to_int(cliprect.x2), mpl_round_to_int(height - cliprect.y1)); + return clip; +} + +// Blit one coverage bitmap, laid out row-major, with *y* its bottom edge. +inline void RendererAgg::blend_text_bitmap( + GCAgg &gc, const agg::int8u *covers, int rows, int cols, int x, int y, + const std::optional &clip) +{ + agg::rect_i fig, text; + auto deltay = y - rows; + fig.init(0, 0, width, height); + text.init(x, deltay, x + cols, y); + text.clip(fig); + if (clip) { + text.clip(*clip); + } + if (text.x2 > text.x1) { + auto deltax = text.x2 - text.x1; + auto deltax2 = text.x1 - x; + for (auto yi = text.y1; yi < text.y2; ++yi) { + pixFmt.blend_solid_hspan(text.x1, yi, deltax, gc.color, + covers + (yi - deltay) * cols + deltax2); + } + } +} + template inline void RendererAgg::draw_text_image(GCAgg &gc, ImageArray &image, int x, int y, double angle) { @@ -734,32 +778,38 @@ inline void RendererAgg::draw_text_image(GCAgg &gc, ImageArray &image, int x, in theRasterizer.add_path(rect2); agg::render_scanlines(theRasterizer, slineP8, ri); } else { - agg::rect_i fig, text; + blend_text_bitmap(gc, &image(0, 0), static_cast(image.shape(0)), + static_cast(image.shape(1)), x, y, + text_clip_rect(gc.cliprect)); + } - int deltay = y - image.shape(0); + pixFmt.comp_op(agg::comp_op_src_over); +} - fig.init(0, 0, width, height); - text.init(x, deltay, x + image.shape(1), y); - text.clip(fig); +// Blit the glyph bitmaps packed by `ft2font._render_glyph_run`. +template +inline void RendererAgg::draw_text_images( + GCAgg &gc, BufferArray &buffer, PositionArray &positions) +{ + if (positions.shape(0) == 0) { + return; + } - if (gc.cliprect.x1 != 0.0 || gc.cliprect.y1 != 0.0 || gc.cliprect.x2 != 0.0 || gc.cliprect.y2 != 0.0) { - agg::rect_i clip; + pixFmt.comp_op(gc.comp_op); - clip.init(mpl_round_to_int(gc.cliprect.x1), - mpl_round_to_int(height - gc.cliprect.y2), - mpl_round_to_int(gc.cliprect.x2), - mpl_round_to_int(height - gc.cliprect.y1)); - text.clip(clip); - } + theRasterizer.reset_clipping(); + rendererBase.reset_clipping(true); - if (text.x2 > text.x1) { - int deltax = text.x2 - text.x1; - int deltax2 = text.x1 - x; - for (int yi = text.y1; yi < text.y2; ++yi) { - pixFmt.blend_solid_hspan(text.x1, yi, deltax, gc.color, - &image(yi - deltay, deltax2)); - } - } + auto const& clip = text_clip_rect(gc.cliprect); + auto data = buffer.data(0); + for (py::ssize_t i = 0; i < positions.shape(0); i++) { + auto offset = positions(i, 0); + auto rows = static_cast(positions(i, 1)); + auto cols = static_cast(positions(i, 2)); + // Positions this far out are clipped away, so narrowing is safe. + auto x = static_cast(positions(i, 3)); + auto y = static_cast(positions(i, 4)); + blend_text_bitmap(gc, data + offset, rows, cols, x, y, clip); } pixFmt.comp_op(agg::comp_op_src_over); diff --git a/src/_backend_agg_wrapper.cpp b/src/_backend_agg_wrapper.cpp index 21c1b8901c81..4d225a1c5772 100644 --- a/src/_backend_agg_wrapper.cpp +++ b/src/_backend_agg_wrapper.cpp @@ -70,6 +70,36 @@ PyRendererAgg_draw_text_image(RendererAgg *self, self->draw_text_image(gc, image, x, y, angle); } +static void +PyRendererAgg_draw_text_images( + RendererAgg *self, + py::array_t buffer_obj, + py::array_t positions_obj, + GCAgg &gc) +{ + if (positions_obj.ndim() != 2 || positions_obj.shape(1) != 5) { + throw py::value_error("positions must be of shape (N, 5)"); + } + auto buffer = buffer_obj.unchecked<1>(); + auto positions = positions_obj.unchecked<2>(); + + // The renderer indexes into the buffer with these. + auto const& size = buffer.shape(0); + for (auto i = 0; i < positions.shape(0); i++) { + auto const& offset = positions(i, 0); + auto const& rows = positions(i, 1); + auto const& cols = positions(i, 2); + if (offset < 0 || rows < 0 || cols < 0 || offset > size || + (rows > 0 && cols > (size - offset) / rows)) { + throw py::value_error( + "positions describes a bitmap outside of buffer at row " + + std::to_string(i)); + } + } + + self->draw_text_images(gc, buffer, positions); +} + static void PyRendererAgg_draw_markers(RendererAgg *self, GCAgg &gc, @@ -206,6 +236,8 @@ PYBIND11_MODULE(_backend_agg, m, py::mod_gil_not_used()) "face"_a = nullptr) .def("draw_text_image", &PyRendererAgg_draw_text_image, "image"_a, "x"_a, "y"_a, "angle"_a, "gc"_a) + .def("draw_text_images", &PyRendererAgg_draw_text_images, + "buffer"_a, "positions"_a, "gc"_a) .def("draw_image", &PyRendererAgg_draw_image, "gc"_a, "x"_a, "y"_a, "image"_a) .def("draw_path_collection", &PyRendererAgg_draw_path_collection, diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 10acd2653c7a..35987ac386b2 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -10,10 +10,15 @@ #include "ft2font.h" #include "mplutils.h" +#include #include #include #include +#ifndef M_PI +#define M_PI 3.14159265358979323846264338328 +#endif + namespace py = pybind11; using namespace pybind11::literals; @@ -1432,6 +1437,120 @@ PyFT2Font_layout(PyFT2Font *self, std::u32string text, LoadFlags flags, return items; } +const char *PyFT2Font_render_glyph_run__doc__ = R"""( + Render a run of glyphs, packed for a single blit by the renderer. + + Every glyph in the run is positioned and rasterized here, so that drawing + text does not cross into Python once per glyph. + + Parameters + ---------- + glyphs : list of (FT2Font, float, int, float, float, float, float) + The font, size, glyph index, slant, extend and offsets of each glyph, + as produced by `.FT2Font._layout` or the mathtext parser. + dpi : float + The resolution to size the fonts at. + x, y : float + Where to place the run. *y* is downwards. + angle : float + The rotation of the run, in degrees. + height : float + The height of the target canvas, as *y* is measured from its top. + flags : LoadFlags + The flags to load the glyphs with. + render_mode : RenderMode + The mode to rasterize the glyphs with. + + Returns + ------- + buffer : np.ndarray of uint8 + The coverage bitmaps of every glyph, packed end to end. + positions : np.ndarray of int + One row per glyph, holding its offset into *buffer*, its number of rows + and columns, and the x and y to blit it at. +)"""; + +static py::tuple +PyFT2Font_render_glyph_run( + FT_Library ft2Library, py::sequence glyphs, double dpi, double x, double y, + double angle, double height, LoadFlags flags, FT_Render_Mode render_mode) +{ + auto load_flags = static_cast(flags); + auto cos = std::cos(angle * (M_PI / 180.0)); + auto sin = std::sin(angle * (M_PI / 180.0)); + auto round = [](double value) { return (FT_Fixed)std::nearbyint(value); }; + + auto done_bitmap = [ft2Library](FT_Bitmap *b) { FT_Bitmap_Done(ft2Library, b); }; + + std::vector buffer; + std::vector positions; + PyFT2Font *sized_font = nullptr; + double sized_size = 0; + + for (auto const& item : glyphs) { + auto const& glyph = item.cast(); + auto font = glyph[0].cast(); + auto const& size = glyph[1].cast(); + auto const& glyph_index = glyph[2].cast(); + auto const& slant = glyph[3].cast(); + auto const& extend = glyph[4].cast(); + auto const& dx = glyph[5].cast(); + auto const& dy = glyph[6].cast(); // Upwards. + + // set_size recurses into the fallbacks, so only call it on a change. + if (font != sized_font || size != sized_size) { + font->set_size(size, dpi); + sized_font = font; + sized_size = size; + } + font->_set_transform( + {{{round(0x10000 * extend * cos), + round(0x10000 * (extend * slant * cos - sin))}, + {round(0x10000 * extend * sin), + round(0x10000 * (extend * slant * sin + cos))}}}, + {round(0x40 * (x + dx * cos - dy * sin)), + // FreeType's y is upwards. + round(0x40 * (height - y + dx * sin + dy * cos))}); + + auto rendered = + std::unique_ptr, decltype(&FT_Done_Glyph)>( + font->render_glyph(glyph_index, load_flags, render_mode), &FT_Done_Glyph); + auto bitmap_glyph = reinterpret_cast(rendered.get()); + FT_Bitmap bitmap; + FT_Bitmap_Init(&bitmap); + std::unique_ptr converted{&bitmap, done_bitmap}; + FT_CHECK(FT_Bitmap_Convert, ft2Library, &bitmap_glyph->bitmap, &bitmap, 1); + auto rows = static_cast(bitmap.rows); + auto cols = static_cast(bitmap.width); + + positions.push_back(static_cast(buffer.size())); + positions.push_back(rows); + positions.push_back(cols); + positions.push_back(bitmap_glyph->left); + positions.push_back(static_cast(height) - bitmap_glyph->top + rows); + for (auto row = 0; row < rows; row++) { + auto start = bitmap.buffer + row * bitmap.pitch; + buffer.insert(buffer.end(), start, start + cols); + } + if (render_mode == FT_RENDER_MODE_MONO) { + // Monochrome bitmaps convert to 0 and 1, but are blitted as coverage. + for (auto i = buffer.size() - rows * cols; i < buffer.size(); i++) { + buffer[i] *= 0xff; + } + } + } + + auto n = static_cast(positions.size() / 5); + return py::make_tuple( + py::array_t{static_cast(buffer.size()), buffer.data()}, + py::array_t{{n, static_cast(5)}, positions.data()}); +} + +/********************************************************************** + * Deprecations + * */ + + #ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used(), py::multiple_interpreters::per_interpreter_gil()) @@ -1796,6 +1915,15 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used()) }) ; + m.def("_render_glyph_run", + [ft2Library](py::sequence glyphs, double dpi, double x, double y, double angle, + double height, LoadFlags flags, FT_Render_Mode render_mode) { + return PyFT2Font_render_glyph_run(ft2Library, glyphs, dpi, x, y, angle, + height, flags, render_mode); + }, + "glyphs"_a, "dpi"_a, "x"_a, "y"_a, "angle"_a, "height"_a, "flags"_a, + "render_mode"_a, PyFT2Font_render_glyph_run__doc__); + // Ensure FreeType library is closed after all instances of FT2Font are gone by // tying a weak ref to the class itself. // https://pybind11.readthedocs.io/en/stable/advanced/misc.html#module-destructors From a8c0a211884b7d510bea4ef7511cd67012a0ab01 Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Fri, 24 Jul 2026 20:49:46 -0600 Subject: [PATCH 043/210] PERF: Cache the font height metrics used to lay text out --- lib/matplotlib/testing/conftest.py | 11 +++++++ lib/matplotlib/text.py | 48 ++++++++++++++++++++---------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/lib/matplotlib/testing/conftest.py b/lib/matplotlib/testing/conftest.py index c60a38254aad..db95fd7cb569 100644 --- a/lib/matplotlib/testing/conftest.py +++ b/lib/matplotlib/testing/conftest.py @@ -158,6 +158,15 @@ def patched_get_sfnt_table(font, name): """ return None + def patched_get_font_height_metrics(font, fontsize, dpi): + """ + Replace ``_get_font_height_metrics`` with empty results. + + It caches what it reads from the tables emptied out above, so patching + those alone would leave a font measured earlier with its real metrics. + """ + return None, None, None + def patched_get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi): """ Replace ``_get_text_metrics_with_cache`` with fixed results. @@ -194,6 +203,8 @@ def patched_text_draw(self, renderer): monkeypatch.setattr('matplotlib.ft2font.FT2Font.get_sfnt_table', patched_get_sfnt_table) + monkeypatch.setattr('matplotlib.text._get_font_height_metrics', + patched_get_font_height_metrics) monkeypatch.setattr('matplotlib.text._get_text_metrics_with_cache', patched_get_text_metrics_with_cache) monkeypatch.setattr('matplotlib.text.Text.draw', patched_text_draw) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index c7fa8d85184a..3e785e33a8cf 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -44,6 +44,36 @@ def _rotate_point(angle, x, y): return (cos * x - sin * y, sin * x + cos * y) +def _get_font_height_metrics(font, fontsize, dpi, + _cache=weakref.WeakKeyDictionary()): + """ + Return the ascent, descent and line gap of *font*, in pixels, or + ``(None, None, None)`` if it carries neither metrics table. + + Keyed on the font rather than on font properties, which resolve to a font + via the rcParams, and held weakly so that caching never keeps a font alive. + """ + if (metrics := _cache.get(font)) is None: + metrics = _cache[font] = {} + if (key := (fontsize, dpi)) not in metrics: + possible = [ + ('OS/2', 'sTypoLineGap', 'sTypoAscender', 'sTypoDescender'), + ('hhea', 'lineGap', 'ascent', 'descent') + ] + metrics[key] = (None, None, None) + for table_name, linegap_key, ascent_key, descent_key in possible: + table = font.get_sfnt_table(table_name) + if table is None: + continue + # Rescale to font size/DPI if the metrics were available. + units_per_em = font.get_sfnt_table('head')['unitsPerEm'] + scale = 1 / units_per_em * fontsize * dpi / 72 + metrics[key] = (table[ascent_key] * scale, -table[descent_key] * scale, + table[linegap_key] * scale) + break + return metrics[key] + + def _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi): """Call ``renderer.get_text_width_height_descent``, caching the results.""" @@ -444,22 +474,8 @@ def _get_layout(self, renderer): self._fontproperties) if min_ascent is None: font = get_font(fontManager._find_fonts_by_props(self._fontproperties)) - possible = [ - ('OS/2', 'sTypoLineGap', 'sTypoAscender', 'sTypoDescender'), - ('hhea', 'lineGap', 'ascent', 'descent') - ] - for table_name, linegap_key, ascent_key, descent_key in possible: - table = font.get_sfnt_table(table_name) - if table is None: - continue - # Rescale to font size/DPI if the metrics were available. - fontsize = self._fontproperties.get_size_in_points() - units_per_em = font.get_sfnt_table('head')['unitsPerEm'] - scale = 1 / units_per_em * fontsize * dpi / 72 - line_gap = table[linegap_key] * scale - min_ascent = table[ascent_key] * scale - min_descent = -table[descent_key] * scale - break + min_ascent, min_descent, line_gap = _get_font_height_metrics( + font, self._fontproperties.get_size_in_points(), dpi) if None in (min_ascent, min_descent): # Fallback to font measurement. _, h, min_descent = _get_text_metrics_with_cache( From a57593227e95c5117cdd0a496bc59d9908b9895e Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Sat, 5 Sep 2026 18:14:53 -0600 Subject: [PATCH 044/210] Commonize glyph loaders to operate on pointers --- src/ft2font.cpp | 85 ++++++++++++++++++----------------------- src/ft2font.h | 18 ++++++--- src/ft2font_wrapper.cpp | 19 ++++----- 3 files changed, 57 insertions(+), 65 deletions(-) diff --git a/src/ft2font.cpp b/src/ft2font.cpp index aefa97d1e647..8f9a8585dc93 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -219,7 +219,7 @@ void FT2Font::close() FT_Done_Glyph(glyph); } glyphs.clear(); - clear_glyph_cache(); + glyph_cache.clear(); layout_cache.clear(); if (face) { @@ -228,14 +228,6 @@ void FT2Font::close() } } -void FT2Font::clear_glyph_cache() -{ - for (auto & [key, cached] : glyph_cache) { - FT_Done_Glyph(cached.glyph); - } - glyph_cache.clear(); -} - void FT2Font::clear() { pen.x = pen.y = 0; @@ -518,18 +510,20 @@ void FT2Font::set_text( } // extract glyph image and store it in our table - auto thisGlyph = wrapped_font->load_glyph_copy(rglyph.index, flags); + GlyphPtr thisGlyph; + FT_Fixed linear_hori_advance = 0; // Unused. + wrapped_font->load_glyph_copy(rglyph.index, flags, thisGlyph, linear_hori_advance); pen.x += rglyph.x_offset; pen.y += rglyph.y_offset; - FT_Glyph_Transform(thisGlyph, nullptr, &pen); - FT_Glyph_Transform(thisGlyph, &matrix, nullptr); + FT_Glyph_Transform(thisGlyph.get(), nullptr, &pen); + FT_Glyph_Transform(thisGlyph.get(), &matrix, nullptr); xys.push_back(pen.x); xys.push_back(pen.y); FT_BBox glyph_bbox; - FT_Glyph_Get_CBox(thisGlyph, FT_GLYPH_BBOX_SUBPIXELS, &glyph_bbox); + FT_Glyph_Get_CBox(thisGlyph.get(), FT_GLYPH_BBOX_SUBPIXELS, &glyph_bbox); bbox.xMin = std::min(bbox.xMin, glyph_bbox.xMin); bbox.xMax = std::max(bbox.xMax, glyph_bbox.xMax); @@ -539,7 +533,8 @@ void FT2Font::set_text( pen.x += rglyph.x_advance - rglyph.x_offset; pen.y += rglyph.y_advance - rglyph.y_offset; - glyphs.push_back(thisGlyph); + glyphs.push_back(thisGlyph.get()); + thisGlyph.release(); // `glyphs` owns it now. } FT_Vector_Transform(&pen, &matrix); @@ -680,9 +675,11 @@ bool FT2Font::load_char_with_fallback(FT2Font *&ft_object_with_glyph, void FT2Font::load_glyph(FT_UInt glyph_index, FT_Int32 flags) { FT_CHECK(FT_Load_Glyph, face, glyph_index, flags); - FT_Glyph thisGlyph; - FT_CHECK(FT_Get_Glyph, face->glyph, &thisGlyph); - glyphs.push_back(thisGlyph); + FT_Glyph glyph = nullptr; + FT_CHECK(FT_Get_Glyph, face->glyph, &glyph); + GlyphPtr owned{glyph}; + glyphs.push_back(owned.get()); + owned.release(); // `glyphs` owns it now. } FT2Font::CachedGlyph const *FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 flags) @@ -710,7 +707,7 @@ FT2Font::CachedGlyph const *FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 f auto const linear_hori_advance = face->glyph->linearHoriAdvance; FT_Set_Transform(face, &glyph_matrix, &glyph_delta); if (glyph_cache.size() >= glyph_cache_max) { - clear_glyph_cache(); + glyph_cache.clear(); } return &(glyph_cache[key] = CachedGlyph{nullptr, linear_hori_advance}); } @@ -722,50 +719,44 @@ FT2Font::CachedGlyph const *FT2Font::cache_glyph(FT_UInt glyph_index, FT_Int32 f if (glyph_error) { THROW_FT_ERROR("FT_Get_Glyph", glyph_error); } - auto owned = std::unique_ptr, decltype(&FT_Done_Glyph)>{ - glyph, &FT_Done_Glyph}; + GlyphPtr owned{glyph}; if (glyph_cache.size() >= glyph_cache_max) { - clear_glyph_cache(); + glyph_cache.clear(); } - auto const& entry = &(glyph_cache[key] = CachedGlyph{glyph, linear_hori_advance}); - owned.release(); // The cache owns it now. - return entry; + return &(glyph_cache[key] = CachedGlyph{std::move(owned), linear_hori_advance}); } -FT_Glyph FT2Font::load_glyph_copy( - FT_UInt glyph_index, FT_Int32 flags, FT_Fixed *linear_hori_advance) +void FT2Font::load_glyph_copy( + FT_UInt glyph_index, FT_Int32 flags, GlyphPtr &glyph, FT_Fixed &linear_hori_advance) { + glyph.reset(); + linear_hori_advance = 0; auto const& cached = cache_glyph(glyph_index, flags); - FT_Glyph glyph = nullptr; + FT_Glyph copy = nullptr; if (cached->glyph) { - FT_CHECK(FT_Glyph_Copy, cached->glyph, &glyph); + FT_CHECK(FT_Glyph_Copy, cached->glyph.get(), ©); } else { // Not an outline, so load it the slow way. FT_CHECK(FT_Load_Glyph, face, glyph_index, flags); - FT_CHECK(FT_Get_Glyph, face->glyph, &glyph); + FT_CHECK(FT_Get_Glyph, face->glyph, ©); } - auto owned = std::unique_ptr, decltype(&FT_Done_Glyph)>{ - glyph, &FT_Done_Glyph}; + glyph.reset(copy); if (cached->glyph && (glyph_delta.x || glyph_delta.y)) { - FT_CHECK(FT_Glyph_Transform, glyph, nullptr, &glyph_delta); + FT_CHECK(FT_Glyph_Transform, copy, nullptr, &glyph_delta); } - if (linear_hori_advance) { - *linear_hori_advance = cached->linear_hori_advance; - } - return owned.release(); + linear_hori_advance = cached->linear_hori_advance; } -FT_Fixed FT2Font::load_glyph_cached(FT_UInt glyph_index, FT_Int32 flags) +void FT2Font::load_glyph_cached( + FT_UInt glyph_index, FT_Int32 flags, FT_Fixed &linear_hori_advance) { - FT_Fixed linear_hori_advance = 0; - auto owned = std::unique_ptr, decltype(&FT_Done_Glyph)>{ - load_glyph_copy(glyph_index, flags, &linear_hori_advance), &FT_Done_Glyph}; - glyphs.push_back(owned.get()); - owned.release(); // `glyphs` owns it now. - return linear_hori_advance; + GlyphPtr glyph; + load_glyph_copy(glyph_index, flags, glyph, linear_hori_advance); + glyphs.push_back(glyph.get()); + glyph.release(); // `glyphs` owns it now. } -FT_Glyph FT2Font::render_glyph( +FT2Font::GlyphPtr FT2Font::render_glyph( FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode) { auto const& cached = cache_glyph(glyph_index, flags); @@ -774,14 +765,14 @@ FT_Glyph FT2Font::render_glyph( FT_CHECK(FT_Render_Glyph, face->glyph, render_mode); FT_Glyph glyph = nullptr; FT_CHECK(FT_Get_Glyph, face->glyph, &glyph); - return glyph; + return GlyphPtr{glyph}; } // With `destroy` false this translates the cached outline, rasterizes it, // and translates it back. - FT_Glyph glyph = cached->glyph; + FT_Glyph glyph = cached->glyph.get(); FT_CHECK(FT_Glyph_To_Bitmap, &glyph, render_mode, &glyph_delta, false); - return glyph; + return GlyphPtr{glyph}; } FT_UInt FT2Font::get_char_index(FT_ULong charcode, bool fallback = false) diff --git a/src/ft2font.h b/src/ft2font.h index d4d689998deb..7742e6231e86 100644 --- a/src/ft2font.h +++ b/src/ft2font.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -103,6 +104,10 @@ class FT2Font public: using LanguageRange = std::tuple; using LanguageType = std::optional>; + struct GlyphDeleter { + void operator()(FT_Glyph glyph) const { FT_Done_Glyph(glyph); } + }; + using GlyphPtr = std::unique_ptr, GlyphDeleter>; FT2Font(std::vector &fallback_list, bool warn_if_used); virtual ~FT2Font(); @@ -134,10 +139,11 @@ class FT2Font FT_Error &glyph_error, std::set &glyph_seen_fonts); void load_glyph(FT_UInt glyph_index, FT_Int32 flags); - FT_Glyph load_glyph_copy(FT_UInt glyph_index, FT_Int32 flags, - FT_Fixed *linear_hori_advance = nullptr); - FT_Fixed load_glyph_cached(FT_UInt glyph_index, FT_Int32 flags); - FT_Glyph render_glyph(FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode); + void load_glyph_copy(FT_UInt glyph_index, FT_Int32 flags, + GlyphPtr &glyph, FT_Fixed &linear_hori_advance); + void load_glyph_cached(FT_UInt glyph_index, FT_Int32 flags, + FT_Fixed &linear_hori_advance); + GlyphPtr render_glyph(FT_UInt glyph_index, FT_Int32 flags, FT_Render_Mode render_mode); std::tuple get_width_height(); std::tuple get_bitmap_offset(); long get_descent(); @@ -190,11 +196,11 @@ class FT2Font FT_Fixed, FT_Fixed, FT_Fixed, FT_Fixed>; static constexpr size_t glyph_cache_max = 1024; struct CachedGlyph { - FT_Glyph glyph; + GlyphPtr glyph; FT_Fixed linear_hori_advance; // Unaffected by the transform. }; + // The result is only valid until the next call. CachedGlyph const *cache_glyph(FT_UInt glyph_index, FT_Int32 flags); - void clear_glyph_cache(); // The size and charmap of one face. The charmap is a counter, as FreeType // offers no cheap way to identify the selected one. diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 35987ac386b2..19b8d4517d90 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -1411,9 +1411,8 @@ PyFT2Font_layout(PyFT2Font *self, std::u32string text, LoadFlags flags, for (auto &glyph : glyphs) { auto ft_object = static_cast(glyph.ftface->generic.data); - // Note, linearHoriAdvance is a 16.16 instead of 26.6 fixed-point value. - auto const& linear_hori_advance = - ft_object->load_glyph_cached(glyph.index, load_flags) / 1024.0; + FT_Fixed linear_hori_advance = 0; + ft_object->load_glyph_cached(glyph.index, load_flags, linear_hori_advance); double prev_kern = 0.0; if (prev_advance) { @@ -1431,7 +1430,8 @@ PyFT2Font_layout(PyFT2Font *self, std::u32string text, LoadFlags flags, prev_x = x + glyph.x_offset; x += glyph.x_advance; y += glyph.y_advance; - prev_advance = linear_hori_advance; + // Note, linearHoriAdvance is a 16.16 instead of 26.6 fixed-point value. + prev_advance = linear_hori_advance / 1024.0; } return items; @@ -1512,9 +1512,7 @@ PyFT2Font_render_glyph_run( // FreeType's y is upwards. round(0x40 * (height - y + dx * sin + dy * cos))}); - auto rendered = - std::unique_ptr, decltype(&FT_Done_Glyph)>( - font->render_glyph(glyph_index, load_flags, render_mode), &FT_Done_Glyph); + auto rendered = font->render_glyph(glyph_index, load_flags, render_mode); auto bitmap_glyph = reinterpret_cast(rendered.get()); FT_Bitmap bitmap; FT_Bitmap_Init(&bitmap); @@ -1905,11 +1903,8 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used()) [ft2Library](PyFT2Font *self, FT_UInt idx, LoadFlags flags, FT_Render_Mode render_mode) { - auto const& glyph = - std::unique_ptr, - decltype(&FT_Done_Glyph)>( - self->render_glyph(idx, static_cast(flags), render_mode), - &FT_Done_Glyph); + auto glyph = self->render_glyph( + idx, static_cast(flags), render_mode); return PyPositionedBitmap{ ft2Library, reinterpret_cast(glyph.get())}; }) From a804f0748050beefb10604e1a9cdf8258a7bffba Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Mon, 21 Sep 2026 09:45:43 -0700 Subject: [PATCH 045/210] Add test case --- lib/matplotlib/tests/test_font_manager.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/matplotlib/tests/test_font_manager.py b/lib/matplotlib/tests/test_font_manager.py index 442dedbaf814..4b59d21f994c 100644 --- a/lib/matplotlib/tests/test_font_manager.py +++ b/lib/matplotlib/tests/test_font_manager.py @@ -215,6 +215,19 @@ def test_get_macos_fonts(tmpdir, monkeypatch): assert assorted_system_fonts.issubset(fonts_found) +def _test_macos_can_use_appkit_after_using_coretext(): + # Make sure that AppKit works after using _get_macos_fonts(). See #32376 + _get_macos_fonts() + mpl.use("macosx") + plt.figure() + plt.show(block=False) + + +@pytest.mark.skipif(sys.platform != 'darwin', reason='macOS only') +def test_macos_can_use_appkit_after_using_coretext(tmpdir, monkeypatch): + subprocess_run_helper(_test_macos_can_use_appkit_after_using_coretext, timeout=10) + + @pytest.mark.skipif(sys.platform != 'linux' or not has_fclist, reason='only Linux with fontconfig installed') def test_user_fonts_linux(tmpdir, monkeypatch): From 3984d05cbee3b8c295c1c9253b74ecc26ea6433a Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Mon, 21 Sep 2026 11:17:33 -0700 Subject: [PATCH 046/210] Ensure agg is set as MPLBACKEND before spawning subprocess --- lib/matplotlib/tests/test_font_manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_font_manager.py b/lib/matplotlib/tests/test_font_manager.py index 4b59d21f994c..46fe2a245075 100644 --- a/lib/matplotlib/tests/test_font_manager.py +++ b/lib/matplotlib/tests/test_font_manager.py @@ -225,7 +225,11 @@ def _test_macos_can_use_appkit_after_using_coretext(): @pytest.mark.skipif(sys.platform != 'darwin', reason='macOS only') def test_macos_can_use_appkit_after_using_coretext(tmpdir, monkeypatch): - subprocess_run_helper(_test_macos_can_use_appkit_after_using_coretext, timeout=10) + subprocess_run_helper( + _test_macos_can_use_appkit_after_using_coretext, + timeout=10, + extra_env={"MPLBACKEND": "agg"} + ) @pytest.mark.skipif(sys.platform != 'linux' or not has_fclist, From 14f627efeede3b925a3992cc3fea6219be1bfcf9 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Mon, 21 Sep 2026 19:52:17 -0700 Subject: [PATCH 047/210] Simplify steps per review feedback --- .github/workflows/tests.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 442b9be3d3bc..8bd7b9f78ca0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -379,18 +379,12 @@ jobs: -instr-profile default.profdata > info.lcov fi - - name: Collect macOS crash logs - if: failure() && runner.os == 'macOS' - run: | - mkdir -p ./macos_crash_logs - cp -R "$HOME/Library/Logs/DiagnosticReports/" ./macos_crash_logs/ 2>/dev/null - - name: Upload macOS crash logs if: failure() && runner.os == 'macOS' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: macos-crash-logs - path: ./macos_crash_logs + path: ~/Library/Logs/DiagnosticReports/* - name: Upload code coverage if: ${{ !cancelled() && github.event_name != 'schedule' }} From 06c917f86b36a197ba8e7dad06168f7ac70109f9 Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed <68402624+ahmed5145@users.noreply.github.com> Date: Tue, 22 Sep 2026 14:42:42 -0500 Subject: [PATCH 048/210] Fix FigureImage losing its transform when re-added via add_artist Closes #31730 --- lib/matplotlib/image.py | 3 +++ lib/matplotlib/tests/test_image.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index a2029797a681..e971b47a8964 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1409,6 +1409,9 @@ def __init__(self, fig, origin=origin ) self.set_figure(fig) + # Offsets are in pixels, so the transform is always identity. Setting it + # explicitly prevents Figure.add_artist() from overriding it. + self.set_transform(IdentityTransform()) self.ox = offsetx self.oy = offsety self._internal_update(kwargs) diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index fb6a33fe7c0d..60e00baa05a8 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -84,6 +84,19 @@ def test_figimage(suppressComposite): fig.figimage(img[::-1, ::-1], xo=100, yo=100, origin='lower') +@check_figures_equal() +def test_figimage_remove_and_add_artist(fig_test, fig_ref): + # A FigureImage that is removed and re-added via add_artist should draw + # the same as the original. + img = np.arange(100).reshape((10, 10)) + fig_ref.add_subplot() + fig_ref.figimage(img, xo=20, yo=20) + fig_test.add_subplot() + im = fig_test.figimage(img, xo=20, yo=20) + im.remove() + fig_test.add_artist(im) + + def test_image_python_io(): fig, ax = plt.subplots() ax.plot([1, 2, 3]) From c3e7ec49b7c86c0a2f50db6996c448d3f5b2ea74 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 18 Sep 2026 15:47:12 -0400 Subject: [PATCH 049/210] ci: Bump all the macOS builder images Since macOS 14 seems to no longer be supported, Homebrew has been dropping pre-built packages for it as they are updated. Based on statistics from Pillow (which is one of our dependencies), 10.14 and below just barely summed to 0.1% of usage, so we should be safe to stop testing on it. Fixes #32339 --- .github/workflows/cibuildwheel.yml | 2 +- .github/workflows/tests.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 083a46516ab0..350364c60e03 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -110,7 +110,7 @@ jobs: cibw_archs: "ARM64" - os: macos-15-intel cibw_archs: "x86_64" - - os: macos-14 + - os: macos-15 cibw_archs: "arm64" steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8bd7b9f78ca0..b896306a8f44 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -77,15 +77,15 @@ jobs: python-version: '3.14' - os: ubuntu-24.04-arm python-version: '3.12' - - os: macos-14 # This runner is on M1 (arm64) chips. + - os: macos-15 # This runner is on M1 (arm64) chips. python-version: '3.12' # https://github.com/matplotlib/matplotlib/issues/29732 pygobject-ver: '<3.52.0' - - os: macos-15 # This runner is on M1 (arm64) chips. + - os: macos-26 # This runner is on M1 (arm64) chips. python-version: '3.13' # https://github.com/matplotlib/matplotlib/issues/29732 pygobject-ver: '<3.52.0' - - os: macos-15 # This runner is on M1 (arm64) chips. + - os: macos-26 # This runner is on M1 (arm64) chips. python-version: '3.14' # https://github.com/matplotlib/matplotlib/issues/29732 pygobject-ver: '<3.52.0' From d4433f7b74a76a18141ba44ab286921322a19e46 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Fri, 18 Sep 2026 08:46:28 -0600 Subject: [PATCH 050/210] TST: batch determinism cases by output format --- lib/matplotlib/tests/test_determinism.py | 62 ++++++++++++++---------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/lib/matplotlib/tests/test_determinism.py b/lib/matplotlib/tests/test_determinism.py index c0e4adbef40b..897d139a4a86 100644 --- a/lib/matplotlib/tests/test_determinism.py +++ b/lib/matplotlib/tests/test_determinism.py @@ -2,7 +2,9 @@ Test output reproducibility. """ +import io import os +import pickle import sys import pytest @@ -22,7 +24,7 @@ from matplotlib.transforms import IdentityTransform -def _save_figure(objects='mhip', fmt="pdf", usetex=False): +def _save_figure(objects='mhip', fmt="pdf", usetex=False, outfile=None): mpl.use(fmt) mpl.rcParams.update({'svg.hashsalt': 'asdf', 'text.usetex': usetex}) @@ -150,52 +152,62 @@ def draw(self, renderer=None): ax.set_xlabel('A string $1+2+\\sigma$') ax.set_ylabel('A string $1+2+\\sigma$') - stdout = getattr(sys.stdout, 'buffer', sys.stdout) - fig.savefig(stdout, format=fmt) + if outfile is None: + outfile = getattr(sys.stdout, 'buffer', sys.stdout) + fig.savefig(outfile, format=fmt) + plt.close(fig) + + +def _save_figures(object_sets, fmt, usetex=False): + """Render multiple figures and serialize their outputs to stdout.""" + outputs = [] + for objects in object_sets: + output = io.BytesIO() + _save_figure(objects, fmt, usetex, output) + outputs.append(output.getvalue()) + pickle.dump(outputs, getattr(sys.stdout, 'buffer', sys.stdout)) @pytest.mark.parametrize( - "objects, fmt, usetex", [ - ("", "pdf", False), - ("m", "pdf", False), - ("h", "pdf", False), - ("i", "pdf", False), - ("mhip", "pdf", False), - ("mhip", "ps", False), - pytest.param("mhip", "ps", True, marks=[needs_usetex, needs_ghostscript]), - ("p", "svg", False), - ("mhip", "svg", False), - pytest.param("mhip", "svg", True, marks=needs_usetex), - ] + "object_sets, fmt, usetex", [ + (("", "m", "h", "i", "mhip"), "pdf", False), + (("mhip",), "ps", False), + pytest.param(("mhip",), "ps", True, + marks=[needs_usetex, needs_ghostscript]), + (("p", "mhip"), "svg", False), + pytest.param(("mhip",), "svg", True, marks=needs_usetex), + ], ids=["pdf", "ps", "ps-usetex", "svg", "svg-usetex"] ) -def test_determinism_check(objects, fmt, usetex): +def test_determinism_check(object_sets, fmt, usetex): """ Output the same graph three times and check that the outputs are exactly the same. Parameters ---------- - objects : str - Objects to be included in the test document: 'm' for markers, 'h' for - hatch patterns, 'i' for images, and 'p' for paths. + object_sets : tuple of str + Objects to be included in each test document: 'm' for markers, 'h' for + hatch patterns, 'i' for images, and 'p' for paths. Cases using the + same format share a subprocess to avoid repeated interpreter startup. fmt : {"pdf", "ps", "svg"} Output format. """ - plots = [ + runs = [ subprocess_run_for_testing( [sys.executable, "-R", "-c", - f"from matplotlib.tests.test_determinism import _save_figure;" - f"_save_figure({objects!r}, {fmt!r}, {usetex})"], + f"from matplotlib.tests.test_determinism import _save_figures;" + f"_save_figures({object_sets!r}, {fmt!r}, {usetex})"], env={**os.environ, "SOURCE_DATE_EPOCH": "946684800", "MPLBACKEND": "Agg"}, text=False, capture_output=True, check=True).stdout for _ in range(3) ] - for p in plots[1:]: + plots_by_run = [pickle.loads(run) for run in runs] + for objects, plots in zip(object_sets, zip(*plots_by_run)): if fmt == "ps" and usetex: - if p != plots[0]: + if any(plot != plots[0] for plot in plots[1:]): pytest.skip("failed, maybe due to ghostscript timestamps") else: - assert p == plots[0] + assert all(plot == plots[0] for plot in plots[1:]), objects @pytest.mark.parametrize( From 426a4313a0cd5eb254100e1fd48bc1e6b2f55681 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Fri, 18 Sep 2026 16:07:07 -0600 Subject: [PATCH 051/210] DOC: limit high-DPI gallery renders to releases --- doc/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index d88b1ae88c89..aa041b91bfbf 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -305,7 +305,9 @@ def autodoc_process_bases(app, name, obj, options, bases): 'filename_pattern': '^((?!sgskip).)*$', 'gallery_dirs': gallery_dirs, 'image_scrapers': (matplotlib_reduced_latex_scraper, ), - 'image_srcset': ["2x"], + # Keep high-DPI images in deployed documentation, but avoid generating the + # additional renders for pull-request builds. + 'image_srcset': ["2x"] if is_release_build else [], 'junit': '../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '', 'matplotlib_animations': sg_matplotlib_animations, 'min_reported_time': 1, From b97c035ef73e1782cb335f88db43f59abac970f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Wed, 26 Aug 2026 19:56:41 -0300 Subject: [PATCH 052/210] DOC: Add captions to devel pages toctree Also: * Align button to bottom of grid-item-card * Fixes checklist spacing --- doc/_static/mpl.css | 21 ++++++++++++++++++--- doc/devel/index.rst | 22 ++++++++++++++++------ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/doc/_static/mpl.css b/doc/_static/mpl.css index 881384478a09..4a4d1384b2a8 100644 --- a/doc/_static/mpl.css +++ b/doc/_static/mpl.css @@ -152,7 +152,6 @@ div.wide-table table th.stub { .checklist { list-style: none; padding: 0; - margin: 0; } .checklist li { margin-left: 24px; @@ -161,7 +160,7 @@ div.wide-table table th.stub { } .checklist li:before { content: "\2610\2001"; - margin-left: -24px; + margin-left: -30px; } .checklist li p { display: inline; @@ -202,13 +201,29 @@ div.wide-table table th.stub { * .. toctree:: * */ - .section-toc.toctree-wrapper .toctree-l1>a{ +.section-toc.toctree-wrapper .toctree-l1>a{ display: none; } .section-toc.toctree-wrapper .toctree-l1>ul{ padding-left: 0; } +/* no-caption-toc is a custom class that removes the caption from a + * toctree listing inside a grid-item-card. + */ +.no-caption-toc>p.caption{ + display: none; +} + +/* Align the button at the bottom of a grid-item-card, so that buttons line up + * across cards whose body text wraps to different heights. + * (used in devel/index) + */ +.sd-card-body.sd-d-flex-column > p:last-child { + margin-top: auto; + margin-bottom: 0; +} + .sidebar-cheatsheets { margin-bottom: 3em; } diff --git a/doc/devel/index.rst b/doc/devel/index.rst index fdeb08d3b202..e5ff8ebb40c7 100644 --- a/doc/devel/index.rst +++ b/doc/devel/index.rst @@ -41,6 +41,7 @@ context that may be necessary for resolving the issue: .. grid-item-card:: :class-header: sd-fs-5 + :class-body: sd-d-flex-column :octicon:`bug;1em;sd-text-info` **Submit a bug report** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -48,13 +49,14 @@ context that may be necessary for resolving the issue: Thank you for your help in keeping bug reports targeted and descriptive. .. button-link:: https://github.com/matplotlib/matplotlib/issues/new/choose - :expand: - :color: primary + :expand: + :color: primary - Report a bug + Report a bug .. grid-item-card:: :class-header: sd-fs-5 + :class-body: sd-d-flex-column :octicon:`light-bulb;1em;sd-text-info` **Request a new feature** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -158,9 +160,9 @@ and managing a development environment and workflow: .. grid-item-card:: :shadow: none - **Install** + **Build and install from source** ^^^ - .. rst-class:: section-toc + .. rst-class:: section-toc no-caption-toc .. toctree:: :maxdepth: 4 @@ -170,7 +172,7 @@ and managing a development environment and workflow: .. grid-item-card:: :shadow: none - **Workflow** + **Development workflow** ^^^^ .. toctree:: @@ -209,8 +211,10 @@ manage, or release manage, these guidelines describe how our current process wor **Code** ^^^ + .. rst-class:: no-caption-toc .. toctree:: :maxdepth: 1 + :caption: Code coding_guide api_changes @@ -222,8 +226,10 @@ manage, or release manage, these guidelines describe how our current process wor **Documentation** ^^^ + .. rst-class:: no-caption-toc .. toctree:: :maxdepth: 1 + :caption: Documentation document style_guide @@ -235,8 +241,10 @@ manage, or release manage, these guidelines describe how our current process wor **Triage And Review** ^^^ + .. rst-class:: no-caption-toc .. toctree:: :maxdepth: 1 + :caption: Triage and Review triage pr_guide @@ -247,8 +255,10 @@ manage, or release manage, these guidelines describe how our current process wor **Maintenance** ^^^ + .. rst-class:: no-caption-toc .. toctree:: :maxdepth: 1 + :caption: Maintenance release_guide communication_guide From 38d3c9748b467ac8677daf0bf57f85e82f9fb0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Wed, 23 Sep 2026 20:12:36 -0300 Subject: [PATCH 053/210] MAINT: Change triage board action to run every 12 hours --- .github/workflows/triage_board.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage_board.yml b/.github/workflows/triage_board.yml index 3ef26369afeb..e3ee13059c0d 100644 --- a/.github/workflows/triage_board.yml +++ b/.github/workflows/triage_board.yml @@ -3,7 +3,7 @@ name: 'Update PR Triage Board' on: schedule: - - cron: '0 * * * *' # Run every hour + - cron: '0 */12 * * *' # Run every 12 hours workflow_dispatch: permissions: {} From d819b44aacd28e743ceb9cb0893699fe6f051386 Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Thu, 24 Sep 2026 09:00:28 +0530 Subject: [PATCH 054/210] DOC: Fix typos in maintenance documentation (#32385) * doc: fix branch name typo in development workflow documentation * doc: fix path typo in documentation about maintenance docs * doc: fix typos in MEP28.rst documentation * doc: fix typos in MEP26.rst documentation * doc: fix typo in MEP 27 documentation --- doc/devel/MEP/MEP26.rst | 4 ++-- doc/devel/MEP/MEP27.rst | 2 +- doc/devel/MEP/MEP28.rst | 6 +++--- doc/devel/development_workflow.rst | 2 +- doc/devel/document.rst | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/devel/MEP/MEP26.rst b/doc/devel/MEP/MEP26.rst index 9d3af8f8c703..2ff1574ff166 100644 --- a/doc/devel/MEP/MEP26.rst +++ b/doc/devel/MEP/MEP26.rst @@ -67,7 +67,7 @@ Implementation It will be easiest to allow a '3rd party' to modify/set the style of an artist if the 'style' is created as a separate class and store against the artist as a -property. The `.GraphicsContextBase` class already provides a the basis of a +property. The `.GraphicsContextBase` class already provides the basis of a ``Style`` class and an artist's `~.Artist.draw` method can be refactored to use the ``Style`` class rather than setting up its own `.GraphicsContextBase` and transferring its style-related properties to it. A minimal example of how this @@ -137,7 +137,7 @@ initial development: Artist Type Selector -Select an `.Artist` by it's type. E.g `.Line2D` or `.Text`:: +Select an `.Artist` by its type. E.g `.Line2D` or `.Text`:: Line2D {attribute: value} diff --git a/doc/devel/MEP/MEP27.rst b/doc/devel/MEP/MEP27.rst index caf032c5c22d..8d58f875830a 100644 --- a/doc/devel/MEP/MEP27.rst +++ b/doc/devel/MEP/MEP27.rst @@ -148,7 +148,7 @@ The description of this MEP gives us most of the solution: Future compatibility ==================== -As eluded to above when discussing MEP 22, this refactor makes it easy +As alluded to above when discussing MEP 22, this refactor makes it easy to add in new generic features. At the moment, MEP 22 has to make ugly hacks to each class extending from ``FigureManagerBase``. With this code, this only needs to get made in the single ``FigureManager`` diff --git a/doc/devel/MEP/MEP28.rst b/doc/devel/MEP/MEP28.rst index 7ae9f8e610d4..001d93750ae1 100644 --- a/doc/devel/MEP/MEP28.rst +++ b/doc/devel/MEP/MEP28.rst @@ -47,7 +47,7 @@ Detailed description Currently, the ``Axes.boxplot`` method accepts parameters that allow the users to specify medians and confidence intervals for each box that will be drawn in the plot. These were provided so that advanced users -could provide statistics computed in a different fashion that the simple +could provide statistics computed in a different fashion than the simple method provided by matplotlib. However, handling this input requires complex logic to make sure that the forms of the data structure match what needs to be drawn. At the moment, that logic contains 9 separate if/else @@ -101,7 +101,7 @@ boxplots will allow users to opt-out of that assumption if the data are known to not fit a normal distribution. Below is an example of how ``Axes.boxplot`` classifies outliers of lognormal -data differently depending one these types of transforms. +data differently depending on these types of transforms. .. plot:: :include-source: true @@ -252,7 +252,7 @@ This MEP can be divided into a few loosely coupled components: #. Removing redundant statistical options in ``Axes.boxplot`` #. Shifting all styling parameter processing from ``Axes.boxplot`` to ``Axes.bxp``. -With this approach, #2 depends and #1, and #4 depends on #3. +With this approach, #2 depends on #1, and #4 depends on #3. There are two possible approaches to #2. The first and most direct would be to mirror the new ``transform_in`` and ``transform_out`` parameters of diff --git a/doc/devel/development_workflow.rst b/doc/devel/development_workflow.rst index 99c7e29234aa..d8b83e049105 100644 --- a/doc/devel/development_workflow.rst +++ b/doc/devel/development_workflow.rst @@ -113,7 +113,7 @@ The editing workflow .. code-block:: none - # On branch ny-new-feature + # On branch my-new-feature # Changed but not updated: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) diff --git a/doc/devel/document.rst b/doc/devel/document.rst index 01a46386d52a..748d54f43b30 100644 --- a/doc/devel/document.rst +++ b/doc/devel/document.rst @@ -31,7 +31,7 @@ See :ref:`writing-examples-and-tutorials`. Third, Matplotlib has informative documentation written in ReST in subdirectories of :file:`doc`. General and historical information about the project is in :file:`doc/project`, the installation guide is in :file:`doc/install`, and release notes are managed in -:file:`doc/release`. Maintenance documentation is in :file:`doc\devel` and the website +:file:`doc/release`. Maintenance documentation is in :file:`doc/devel` and the website always redirects to the latest version of these documents. We also maintain a list of external resources in :file:`doc/users/resources/index.rst`. To improve these documents or add resources, see :ref:`writing-rest-pages`. From 07cb36696a08719bdf3500feeef638b6313daeee Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Thu, 24 Sep 2026 10:09:49 -0700 Subject: [PATCH 055/210] Check for macOS warning in stderr On macOS 26, we randomly crash before qt gets a chance to print the error message. --- lib/matplotlib/tests/test_backends_interactive.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 921653c78269..73332b9c3c85 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -467,7 +467,9 @@ def test_cross_Qt_imports(host, mpl): stderr = ex.stderr else: stderr = proc.stderr - assert "Mixing Qt major versions may not work as expected." in stderr + did_qt_warn = "Mixing Qt major versions may not work as expected." in stderr + did_macos_warn = "spurious casting failures and mysterious crashes" in stderr + assert did_qt_warn or did_macos_warn @pytest.mark.skipif('TF_BUILD' in os.environ, From 54294bd11c482a0cd068dc6ca0ccb1ff3d9deecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Thu, 24 Sep 2026 15:48:43 -0300 Subject: [PATCH 056/210] Lint Co-authored-by: Greg Lucas --- .github/workflows/triage_board.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/triage_board.yml b/.github/workflows/triage_board.yml index e3ee13059c0d..e59645deea2d 100644 --- a/.github/workflows/triage_board.yml +++ b/.github/workflows/triage_board.yml @@ -3,7 +3,7 @@ name: 'Update PR Triage Board' on: schedule: - - cron: '0 */12 * * *' # Run every 12 hours + - cron: '0 */12 * * *' # Run every 12 hours workflow_dispatch: permissions: {} From 4013e78545a0dfab304d54e3b22ec87ca3a01ca5 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 25 Sep 2026 11:18:32 -0400 Subject: [PATCH 057/210] Fix spacing in docstrings --- lib/matplotlib/colorizer.py | 4 ++-- lib/matplotlib/colors.py | 10 +++++----- lib/matplotlib/offsetbox.py | 12 ++++++------ lib/matplotlib/widgets.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/matplotlib/colorizer.py b/lib/matplotlib/colorizer.py index 99cbcf157db4..323fc91d0718 100644 --- a/lib/matplotlib/colorizer.py +++ b/lib/matplotlib/colorizer.py @@ -44,10 +44,10 @@ class Colorizer: Parameters ---------- - cmap: colorbar.Colorbar or str or None, default: None + cmap : colorbar.Colorbar or str or None, default: None The colormap used to color data. - norm: colors.Normalize or str or None, default: None + norm : colors.Normalize or str or None, default: None The normalization used to normalize the data """ def __init__(self, cmap=None, norm=None): diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 7afdb0237f8c..51e2d9950dc9 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -1438,9 +1438,9 @@ def __init__(self, colormaps, combination_mode, name='multivariate colormap'): """ Parameters ---------- - colormaps: list or tuple of `~matplotlib.colors.Colormap` objects + colormaps : list or tuple of `~matplotlib.colors.Colormap` objects The individual colormaps that are combined - combination_mode: str, 'sRGB_add' or 'sRGB_sub' + combination_mode : str, 'sRGB_add' or 'sRGB_sub' Describe how colormaps are combined in sRGB space - If 'sRGB_add' -> Mixing produces brighter colors @@ -2051,7 +2051,7 @@ def _clip(self, X): Parameters ---------- - X: np.array + X : np.array array of floats or ints to be clipped shape : {'square', 'circle', 'ignore', 'circleignore'} @@ -2266,7 +2266,7 @@ class BivarColormapFromImage(BivarColormap): ---------- lut : nparray of shape (N, M, 3) or (N, M, 4) The look-up-table - shape: {'square', 'circle', 'ignore', 'circleignore'} + shape : {'square', 'circle', 'ignore', 'circleignore'} - If 'square' each variate is clipped to [0,1] independently - If 'circle' the variates are clipped radially to the center @@ -2276,7 +2276,7 @@ class BivarColormapFromImage(BivarColormap): 'outside' color - If 'circleignore' a circular mask is applied, but the data is not clipped - origin: (float, float) + origin : (float, float) The relative origin of the colormap. Typically (0, 0), for colormaps that are linear on both axis, and (.5, .5) for circular colormaps. Used when getting 1D colormaps from 2D colormaps. diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py index ca19a26f2b17..71827554fd39 100644 --- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -1164,7 +1164,7 @@ class OffsetImage(OffsetBox): Parameters ---------- - arr: array-like or `PIL.Image.Image` + arr : array-like or `PIL.Image.Image` The data to be color-coded. The interpretation depends on the shape: @@ -1172,7 +1172,7 @@ class OffsetImage(OffsetBox): - (M, N, 3): RGB array - (M, N, 4): RGBA array - zoom: float, default: 1 + zoom : float, default: 1 zoom factor: - no zoom: factor =1 @@ -1214,7 +1214,7 @@ class OffsetImage(OffsetBox): When True, use a full resampling method. When False, only resample when the output image is larger than the input image. - dpi_cor: bool, default: True + dpi_cor : bool, default: True Correct for the backend DPI setting **kwargs : `.BboxImage` properties @@ -1339,7 +1339,7 @@ def __init__(self, offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, * (accessible as the ``patch`` attribute of the `.AnnotationBbox`). If *frameon* is set to False, this patch is made invisible. - annotation_clip: bool or None, default: None + annotation_clip : bool or None, default: None Whether to clip (i.e. not draw) the annotation when the annotation point *xy* is outside the Axes area. @@ -1362,10 +1362,10 @@ def __init__(self, offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, * for example *boxstyle* and *alpha*. See `.FancyBboxPatch` for details. - arrowprops: dict, optional + arrowprops : dict, optional Arrow properties, see `.Annotation` for description. - fontsize: float or str, optional + fontsize : float or str, optional Translated to points and passed as *mutation_scale* into `.FancyBboxPatch` to scale attributes of the box style (e.g. pad or rounding_size). The name is chosen in analogy to `.Text` where diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index daec97f42ce6..347aaff0286d 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -4403,7 +4403,7 @@ class Lasso(AxesWidget): Whether to use blitting for faster drawing (if supported by the backend). See the tutorial :ref:`blitting` for details. - props: dict, optional + props : dict, optional Lasso line properties. See `.Line2D` for valid properties. Default *props* are:: From 1cc5637d5df35047ec74ebab93c173da99905279 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2026 19:18:20 +0000 Subject: [PATCH 058/210] Bump the actions group with 4 updates Bumps the actions group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action), [reviewdog/action-eslint](https://github.com/reviewdog/action-eslint) and [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `github/codeql-action/init` from 4.38.0 to 4.38.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/b96794f015dfd88f77b49b1c93e0fa7110f94c63...1c5b675653bb5c22dbe9b12b556ec555138e09fd) Updates `github/codeql-action/analyze` from 4.38.0 to 4.38.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/b96794f015dfd88f77b49b1c93e0fa7110f94c63...1c5b675653bb5c22dbe9b12b556ec555138e09fd) Updates `reviewdog/action-eslint` from 1.34.0 to 1.36.0 - [Release notes](https://github.com/reviewdog/action-eslint/releases) - [Commits](https://github.com/reviewdog/action-eslint/compare/556a3fdaf8b4201d4d74d406013386aa4f7dab96...b6303df522851d0e9abaea654da0222037d97e75) Updates `codecov/codecov-action` from 7.0.0 to 7.1.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/fb8b3582c8e4def4969c97caa2f19720cb33a72f...303a32d7a59b442fa8d48b6a1cc6825c09c847a5) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.38.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/codeql-action/analyze dependency-version: 4.38.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: reviewdog/action-eslint dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 7.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/linting.yml | 2 +- .github/workflows/tests.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ea6d1941acc7..20141b3fdce8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0 + uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 with: languages: ${{ matrix.language }} @@ -45,4 +45,4 @@ jobs: pip install --user -v . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@b96794f015dfd88f77b49b1c93e0fa7110f94c63 # v4.38.0 + uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f89bd925d356..634c87feaeec 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -128,7 +128,7 @@ jobs: persist-credentials: false - name: eslint - uses: reviewdog/action-eslint@556a3fdaf8b4201d4d74d406013386aa4f7dab96 # v1.34.0 + uses: reviewdog/action-eslint@b6303df522851d0e9abaea654da0222037d97e75 # v1.36.0 with: filter_mode: nofilter github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b896306a8f44..ca6c335ec37b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -388,7 +388,7 @@ jobs: - name: Upload code coverage if: ${{ !cancelled() && github.event_name != 'schedule' }} - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}" token: ${{ secrets.CODECOV_TOKEN }} From fa169c3f82908278c358623301cbcb390a3b2bb6 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Sat, 26 Sep 2026 21:45:42 -0400 Subject: [PATCH 059/210] Use click_and_drag helper and integer call counters in exception tests --- lib/matplotlib/tests/test_widgets.py | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/tests/test_widgets.py b/lib/matplotlib/tests/test_widgets.py index c14de4bfb503..e8a6a29307d4 100644 --- a/lib/matplotlib/tests/test_widgets.py +++ b/lib/matplotlib/tests/test_widgets.py @@ -693,11 +693,12 @@ def test_span_selector_onselect(ax, interactive): def test_selector_callback_exception_resets_state(ax, selector_factory): # An exception from onselect must not leave the selector in a dragging # state. - calls = [] + calls = 0 def onselect(*args): - calls.append(args) - if len(calls) == 1: + nonlocal calls + calls += 1 + if calls == 1: raise RuntimeError("callback failure") tool = selector_factory(ax, onselect) @@ -708,12 +709,7 @@ def onselect(*args): # Drag with the 'move' modifier held so that the 'move' state really is # set when the callback raises. with pytest.raises(RuntimeError, match="callback failure"): - MouseEvent._from_ax_coords( - "button_press_event", ax, (100, 100), 1, key=' ')._process() - MouseEvent._from_ax_coords( - "motion_notify_event", ax, (150, 150), 1, key=' ')._process() - MouseEvent._from_ax_coords( - "button_release_event", ax, (150, 150), 1, key=' ')._process() + click_and_drag(tool, start=(100, 100), end=(150, 150), key=' ') assert tool._eventpress is None assert tool._eventrelease is None @@ -723,18 +719,19 @@ def onselect(*args): # from the previous shape so an interactive selector creates a new one # rather than moving the existing one. click_and_drag(tool, start=(20, 20), end=(70, 70)) - assert len(calls) == 2 + assert calls == 2 assert tool._selection_completed def test_lasso_selector_callback_exception_resets_state(ax): # LassoSelector uses the shared release handler but has a different # callback signature. - calls = [] + calls = 0 def onselect(verts): - calls.append(verts) - if len(calls) == 1: + nonlocal calls + calls += 1 + if calls == 1: raise RuntimeError("callback failure") tool = widgets.LassoSelector(ax, onselect) @@ -747,7 +744,7 @@ def onselect(verts): assert tool._eventrelease is None click_and_drag(tool, start=(100, 100), end=(150, 150)) - assert len(calls) == 2 + assert calls == 2 def test_span_selector_callback_exception_does_not_leak_to_other_selector(): @@ -759,10 +756,11 @@ def test_span_selector_callback_exception_does_not_leak_to_other_selector(): # when a GUI framework is running; force propagation for this test. fig.canvas.callbacks.exception_handler = None - top_calls = [] + top_calls = 0 def failing_onselect(vmin, vmax): - top_calls.append((vmin, vmax)) + nonlocal top_calls + top_calls += 1 raise RuntimeError("callback failure") selections = [] @@ -779,7 +777,7 @@ def failing_onselect(vmin, vmax): click_and_drag(bottom, start=(0.2, 0.2), end=(0.6, 0.2)) # The failed selector must not react to the events on the other Axes. - assert len(top_calls) == 1 + assert top_calls == 1 assert top.extents == top_extents assert selections == [(0.2, 0.6)] assert bottom._selection_completed From 6ae36836d073e51057b58712c50fbe91f3095f13 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Sat, 26 Sep 2026 19:54:23 -0700 Subject: [PATCH 060/210] Fixing configuration for labels --- .github/workflows/pr_welcome.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_welcome.yml b/.github/workflows/pr_welcome.yml index e9d33be877cf..b69f31d917eb 100644 --- a/.github/workflows/pr_welcome.yml +++ b/.github/workflows/pr_welcome.yml @@ -60,8 +60,8 @@ jobs: scan-pull-requests: true scan-issues: true allowed-users: "meeseeksmachine" - label-mixed: "automation: mixed" - label-automated: "automation: automated" - label-community-flagged: "automation: flagged" + label-mixed: "AgentScan: mixed" + label-automation: "AgentScan: automated" + label-community-flagged: "AgentScan: flagged" auto-close: false honeypot: false From 1d63a86bc92dd9d3a90c2e7d103856f86f915a7f Mon Sep 17 00:00:00 2001 From: Leon White Date: Mon, 28 Sep 2026 12:14:30 +0200 Subject: [PATCH 061/210] ci: enable building musllinux_aarch64 wheels --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2ae32a02fbd8..ae08e7b5a354 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -435,7 +435,6 @@ addopts = [ ] [tool.cibuildwheel] -skip = "*-musllinux_aarch64" manylinux-x86_64-image = "manylinux2014" before-build = "rm -rf {package}/build" From bbad3917526e8bec35dddeb4ecc15636d0d2270c Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 28 Sep 2026 09:48:32 -0400 Subject: [PATCH 062/210] MNT: drop pre-commit (the package) dep We have moved to prek but this got missed in the migration. --- doc/devel/development_setup.rst | 11 +++++++---- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/devel/development_setup.rst b/doc/devel/development_setup.rst index 2ee9193c9fa5..c683c54c867e 100644 --- a/doc/devel/development_setup.rst +++ b/doc/devel/development_setup.rst @@ -321,20 +321,23 @@ you are aware of the existing issues beforehand. .. _pre-commit-hooks: -Install pre-commit hooks -======================== +Install git pre-commit hooks +============================ + `prek `_ hooks save time in the review process by identifying issues with the code before a pull request is formally opened. Most hooks can also aide in fixing the errors, and the checks should have corresponding :ref:`development workflow ` and :ref:`pull request ` guidelines. Hooks are configured in `.pre-commit-config.yaml `_ -and include checks for spelling and formatting, flake 8 conformity, accidentally +and include checks for spelling and formatting, style conformity, accidentally committed files, import order, and incorrect branching. Install pre-commit hooks :: - python -m pip install prek + # e.g. + # pixi global install prek + # uv tool install prek prek install Hooks are run automatically after the ``git commit`` stage of the diff --git a/pyproject.toml b/pyproject.toml index 2ae32a02fbd8..04362c8cdf45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ dev = [ {include-group = "doc"}, {include-group = "test"}, {include-group = "test-extra"}, - "pre-commit", + "prek", ] # Requirements for building docs # From ad1c61d0e898536f30e335a7197bb9dc4c38c1ae Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 28 Sep 2026 10:06:06 -0400 Subject: [PATCH 063/210] MNT: switch from isort to ruff for pre-commit (prek) hooks This drops a job from the hooks which should make them faster. Assisted-by: opencode:claude-sonnet-5 --- .pre-commit-config.yaml | 11 +++++------ pyproject.toml | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5425b3fb99ee..25cd1b2cff3e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,6 +49,11 @@ repos: # Run the linter. - id: ruff-check args: [--fix, --show-fixes] + # Sort imports in the galleries, mirroring the previous isort scope. + - id: ruff-check + name: ruff isort (galleries) + args: [--fix, --show-fixes, --select=I001] + files: ^galleries/tutorials/|^galleries/examples/|^galleries/plot_types/ - repo: https://github.com/codespell-project/codespell rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2 hooks: @@ -59,12 +64,6 @@ repos: - "ci/codespell-ignore-words.txt" - "--skip" - "doc/project/credits.rst" - - repo: https://github.com/pycqa/isort - rev: a333737ed43df02b18e6c95477ea1b285b3de15a # frozen: 8.0.1 - hooks: - - id: isort - name: isort (python) - files: ^galleries/tutorials/|^galleries/examples/|^galleries/plot_types/ - repo: https://github.com/rstcheck/rstcheck rev: d8774e96810795967ed9603f445b4e751e7b313f # frozen: v6.3.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 2ae32a02fbd8..b6970faa50c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -171,13 +171,6 @@ local_scheme = "node-and-date" parentdir_prefix_version = "matplotlib-" fallback_version = "0.0+UNKNOWN" -[tool.isort] -known_pydata = "numpy, matplotlib.pyplot" -known_firstparty = "matplotlib,mpl_toolkits" -sections = "FUTURE,STDLIB,THIRDPARTY,PYDATA,FIRSTPARTY,LOCALFOLDER" -force_sort_within_sections = true -line_length = 88 - [tool.ruff] extend-exclude = [ "build", @@ -278,6 +271,21 @@ external = [ [tool.ruff.lint.pydocstyle] convention = "numpy" +[tool.ruff.lint.isort] +known-first-party = ["matplotlib", "mpl_toolkits"] +section-order = [ + "future", + "standard-library", + "third-party", + "pydata", + "first-party", + "local-folder", +] +force-sort-within-sections = true + +[tool.ruff.lint.isort.sections] +pydata = ["numpy", "matplotlib.pyplot"] + [tool.ruff.lint.per-file-ignores] "*.pyi" = ["E501"] "*.ipynb" = ["E402"] From 790265f22dac79c1fb95667b2217f6bf425bc27c Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 28 Sep 2026 10:08:04 -0400 Subject: [PATCH 064/210] STY: run the ruff isort There are a few trivial changes: - drop \ import line continuation - slightly different tie-breaking in mixed from .. import .. and import .. - accept ruff-style line wrapping Still only applies to the galleries. --- .../image_transparency_blend.py | 1 + galleries/examples/misc/anchored_artists.py | 9 ++++-- .../axes_zoom_effect.py | 7 +++-- .../ticks/date_formatters_locators.py | 29 +++++++++++++++---- .../embedding_in_wx2_sgskip.py | 5 ++-- .../embedding_in_wx3_sgskip.py | 5 ++-- .../embedding_in_wx4_sgskip.py | 5 ++-- .../embedding_in_wx5_sgskip.py | 5 ++-- .../embedding_webagg_sgskip.py | 6 ++-- galleries/examples/user_interfaces/mplcvd.py | 2 +- galleries/tutorials/lifecycle.py | 1 + 11 files changed, 55 insertions(+), 20 deletions(-) diff --git a/galleries/examples/images_contours_and_fields/image_transparency_blend.py b/galleries/examples/images_contours_and_fields/image_transparency_blend.py index 31d1d50f757c..b658080e2f13 100644 --- a/galleries/examples/images_contours_and_fields/image_transparency_blend.py +++ b/galleries/examples/images_contours_and_fields/image_transparency_blend.py @@ -16,6 +16,7 @@ """ import matplotlib.pyplot as plt + # sphinx_gallery_thumbnail_number = 3 import numpy as np diff --git a/galleries/examples/misc/anchored_artists.py b/galleries/examples/misc/anchored_artists.py index be600449bba6..a3fc59de03e4 100644 --- a/galleries/examples/misc/anchored_artists.py +++ b/galleries/examples/misc/anchored_artists.py @@ -17,8 +17,13 @@ from matplotlib import pyplot as plt from matplotlib.lines import Line2D -from matplotlib.offsetbox import (AnchoredOffsetbox, AuxTransformBox, DrawingArea, - TextArea, VPacker) +from matplotlib.offsetbox import ( + AnchoredOffsetbox, + AuxTransformBox, + DrawingArea, + TextArea, + VPacker, +) from matplotlib.patches import Circle, Ellipse diff --git a/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py b/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py index 93c7662576e1..48d49b26bb64 100644 --- a/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py +++ b/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py @@ -8,8 +8,11 @@ import matplotlib.pyplot as plt from matplotlib.transforms import Bbox, TransformedBbox, blended_transform_factory -from mpl_toolkits.axes_grid1.inset_locator import (BboxConnector, BboxConnectorPatch, - BboxPatch) +from mpl_toolkits.axes_grid1.inset_locator import ( + BboxConnector, + BboxConnectorPatch, + BboxPatch, +) def connect_bbox(bbox1, bbox2, diff --git a/galleries/examples/ticks/date_formatters_locators.py b/galleries/examples/ticks/date_formatters_locators.py index bc5f1994cd74..eb485f73e670 100644 --- a/galleries/examples/ticks/date_formatters_locators.py +++ b/galleries/examples/ticks/date_formatters_locators.py @@ -13,11 +13,30 @@ import numpy as np # While these appear unused directly, they are used from eval'd strings. -from matplotlib.dates import (FR, MO, MONTHLY, SA, SU, TH, TU, WE, AutoDateFormatter, - AutoDateLocator, ConciseDateFormatter, DateFormatter, - DayLocator, HourLocator, MicrosecondLocator, - MinuteLocator, MonthLocator, RRuleLocator, SecondLocator, - WeekdayLocator, YearLocator, rrulewrapper) +from matplotlib.dates import ( + FR, + MO, + MONTHLY, + SA, + SU, + TH, + TU, + WE, + AutoDateFormatter, + AutoDateLocator, + ConciseDateFormatter, + DateFormatter, + DayLocator, + HourLocator, + MicrosecondLocator, + MinuteLocator, + MonthLocator, + RRuleLocator, + SecondLocator, + WeekdayLocator, + YearLocator, + rrulewrapper, +) import matplotlib.ticker as ticker diff --git a/galleries/examples/user_interfaces/embedding_in_wx2_sgskip.py b/galleries/examples/user_interfaces/embedding_in_wx2_sgskip.py index 634d8c511aa7..584a2c712517 100644 --- a/galleries/examples/user_interfaces/embedding_in_wx2_sgskip.py +++ b/galleries/examples/user_interfaces/embedding_in_wx2_sgskip.py @@ -13,8 +13,9 @@ import numpy as np from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas -from matplotlib.backends.backend_wxagg import \ - NavigationToolbar2WxAgg as NavigationToolbar +from matplotlib.backends.backend_wxagg import ( + NavigationToolbar2WxAgg as NavigationToolbar, +) from matplotlib.figure import Figure diff --git a/galleries/examples/user_interfaces/embedding_in_wx3_sgskip.py b/galleries/examples/user_interfaces/embedding_in_wx3_sgskip.py index 4917180582fe..2a61743fa70e 100644 --- a/galleries/examples/user_interfaces/embedding_in_wx3_sgskip.py +++ b/galleries/examples/user_interfaces/embedding_in_wx3_sgskip.py @@ -27,8 +27,9 @@ import numpy as np from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas -from matplotlib.backends.backend_wxagg import \ - NavigationToolbar2WxAgg as NavigationToolbar +from matplotlib.backends.backend_wxagg import ( + NavigationToolbar2WxAgg as NavigationToolbar, +) import matplotlib.cbook as cbook from matplotlib.figure import Figure diff --git a/galleries/examples/user_interfaces/embedding_in_wx4_sgskip.py b/galleries/examples/user_interfaces/embedding_in_wx4_sgskip.py index 062f1219adb5..fbcb9c59fd63 100644 --- a/galleries/examples/user_interfaces/embedding_in_wx4_sgskip.py +++ b/galleries/examples/user_interfaces/embedding_in_wx4_sgskip.py @@ -11,8 +11,9 @@ import numpy as np from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas -from matplotlib.backends.backend_wxagg import \ - NavigationToolbar2WxAgg as NavigationToolbar +from matplotlib.backends.backend_wxagg import ( + NavigationToolbar2WxAgg as NavigationToolbar, +) from matplotlib.figure import Figure diff --git a/galleries/examples/user_interfaces/embedding_in_wx5_sgskip.py b/galleries/examples/user_interfaces/embedding_in_wx5_sgskip.py index f5442ec1f700..cff9aac6fe00 100644 --- a/galleries/examples/user_interfaces/embedding_in_wx5_sgskip.py +++ b/galleries/examples/user_interfaces/embedding_in_wx5_sgskip.py @@ -16,8 +16,9 @@ import wx.lib.agw.aui as aui from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas -from matplotlib.backends.backend_wxagg import \ - NavigationToolbar2WxAgg as NavigationToolbar +from matplotlib.backends.backend_wxagg import ( + NavigationToolbar2WxAgg as NavigationToolbar, +) from matplotlib.figure import Figure diff --git a/galleries/examples/user_interfaces/embedding_webagg_sgskip.py b/galleries/examples/user_interfaces/embedding_webagg_sgskip.py index 50e245f3db46..d55fc97f11c3 100644 --- a/galleries/examples/user_interfaces/embedding_webagg_sgskip.py +++ b/galleries/examples/user_interfaces/embedding_webagg_sgskip.py @@ -32,8 +32,10 @@ import numpy as np import matplotlib as mpl -from matplotlib.backends.backend_webagg import (FigureManagerWebAgg, - new_figure_manager_given_figure) +from matplotlib.backends.backend_webagg import ( + FigureManagerWebAgg, + new_figure_manager_given_figure, +) from matplotlib.figure import Figure diff --git a/galleries/examples/user_interfaces/mplcvd.py b/galleries/examples/user_interfaces/mplcvd.py index 99c115b8d251..8a9f4d02f234 100644 --- a/galleries/examples/user_interfaces/mplcvd.py +++ b/galleries/examples/user_interfaces/mplcvd.py @@ -10,8 +10,8 @@ import functools from pathlib import Path -from PIL import Image import colour +from PIL import Image import numpy as np diff --git a/galleries/tutorials/lifecycle.py b/galleries/tutorials/lifecycle.py index d932021726da..892073abd906 100644 --- a/galleries/tutorials/lifecycle.py +++ b/galleries/tutorials/lifecycle.py @@ -28,6 +28,7 @@ """ import matplotlib.pyplot as plt + # sphinx_gallery_thumbnail_number = 10 import numpy as np From 9708e31b79dfec36b6ffb8360e4a371615df6d91 Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed <68402624+ahmed5145@users.noreply.github.com> Date: Mon, 28 Sep 2026 11:20:21 -0500 Subject: [PATCH 065/210] TST: drop unneeded subplot from figimage re-add test --- lib/matplotlib/tests/test_image.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index 60e00baa05a8..204a2b0e2dab 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -89,9 +89,7 @@ def test_figimage_remove_and_add_artist(fig_test, fig_ref): # A FigureImage that is removed and re-added via add_artist should draw # the same as the original. img = np.arange(100).reshape((10, 10)) - fig_ref.add_subplot() fig_ref.figimage(img, xo=20, yo=20) - fig_test.add_subplot() im = fig_test.figimage(img, xo=20, yo=20) im.remove() fig_test.add_artist(im) From adaadbdafd574b6405e7e8a66d3083f1d04d44c5 Mon Sep 17 00:00:00 2001 From: Ricci Adams <1097294+iccir@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:19:49 -0700 Subject: [PATCH 066/210] Raise ImportError when cairocffi cannot load cairo (#32400) * Catch OSError from cairocffi and raise as ImportError * Update lib/matplotlib/backends/backend_cairo.py Co-authored-by: Greg Lucas --------- Co-authored-by: Greg Lucas --- lib/matplotlib/backends/backend_cairo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index be17fa693ae3..e0627418b107 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -26,6 +26,8 @@ raise ImportError( "cairo backend requires that pycairo>=1.14.0 or cairocffi " "is installed") from err + except OSError as err: + raise ImportError("cairocffi could not load cairo") from err from .. import _api, cbook, font_manager from matplotlib.artist import BlendMode From b9bb692fbb1235cf4ff09f9de07befaa9b5a3763 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Wed, 30 Sep 2026 20:03:06 -0700 Subject: [PATCH 067/210] Remove _render_glyph and _PositionedBitmap --- lib/matplotlib/tests/test_ft2font.py | 25 ----------- src/ft2font_wrapper.cpp | 65 +--------------------------- 2 files changed, 1 insertion(+), 89 deletions(-) diff --git a/lib/matplotlib/tests/test_ft2font.py b/lib/matplotlib/tests/test_ft2font.py index ab389038ab9a..3b4af9092aeb 100644 --- a/lib/matplotlib/tests/test_ft2font.py +++ b/lib/matplotlib/tests/test_ft2font.py @@ -1077,31 +1077,6 @@ def test__layout(): assert Path(item.ft_object.fname).name == 'cmr10.ttf' -def test_render_glyph_cache(): - # Reusing a cached outline must not change what is rendered. - ft = fm.get_font(fm.findfont('DejaVu Sans')) - ft.set_size(12, 100) - index = ft.get_char_index(ord('e')) - identity = [[0x10000, 0], [0, 0x10000]] - - def render(delta=(0, 0)): - ft._set_transform(identity, list(delta)) - return ft._render_glyph(index, ft2font.LoadFlags.DEFAULT, - ft2font.RenderMode.NORMAL) - - first = render() - reference = first.buffer.copy() - # A whole-pixel shift reuses the outline and only moves the glyph. - shifted = render(delta=(0x40 * 3, 0x40 * 5)) - assert np.array_equal(shifted.buffer, reference) - assert (shifted.left, shifted.top) == (first.left + 3, first.top + 5) - # A fractional shift must reach the rasterizer rather than be rounded away. - assert not np.array_equal(render(delta=(0x20, 0x20)).buffer, reference) - # The size is part of the key. - ft.set_size(24, 100) - assert render().buffer.shape != reference.shape - - def test_layout_cache(): # A cached layout must match a fresh one, and the size is part of the key. ft = fm.get_font(fm.findfont('DejaVu Sans')) diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 19b8d4517d90..df0f967e413e 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -179,47 +179,6 @@ const char *PyFT2Image_draw_rect_filled__doc__ = R"""( The bounds of the rectangle from (x0, y0) to (x1, y1). )"""; -/********************************************************************** - * Positioned Bitmap; owns the FT_Bitmap! - * */ - -struct PyPositionedBitmap { - FT_Library _ft2Library; - FT_Int left, top; - bool owning; - FT_Bitmap bitmap; - - PyPositionedBitmap(FT_Library ft2Library, FT_GlyphSlot slot) : - _ft2Library{ft2Library}, left{slot->bitmap_left}, top{slot->bitmap_top}, owning{true} - { - FT_Bitmap_Init(&bitmap); - FT_CHECK(FT_Bitmap_Convert, _ft2Library, &slot->bitmap, &bitmap, 1); - } - - PyPositionedBitmap(FT_Library ft2Library, FT_BitmapGlyph bg) : - _ft2Library{ft2Library}, left{bg->left}, top{bg->top}, owning{true} - { - FT_Bitmap_Init(&bitmap); - FT_CHECK(FT_Bitmap_Convert, _ft2Library, &bg->bitmap, &bitmap, 1); - } - - PyPositionedBitmap(PyPositionedBitmap& other) = delete; // Non-copyable. - - PyPositionedBitmap(PyPositionedBitmap&& other) : - _ft2Library{other._ft2Library}, left{other.left}, top{other.top}, owning{true}, - bitmap{other.bitmap} - { - other.owning = false; // Prevent double deletion. - } - - ~PyPositionedBitmap() - { - if (owning) { - FT_Bitmap_Done(_ft2Library, &bitmap); - } - } -}; - /********************************************************************** * Glyph * */ @@ -1658,17 +1617,6 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used()) return py::buffer_info(self.get_buffer(), shape, strides); }); - py::classh(m, "_PositionedBitmap", py::is_final()) - .def_readonly("left", &PyPositionedBitmap::left) - .def_readonly("top", &PyPositionedBitmap::top) - .def_property_readonly( - "buffer", [](PyPositionedBitmap &self) -> py::array { - return {{self.bitmap.rows, self.bitmap.width}, - {self.bitmap.pitch, 1}, - self.bitmap.buffer}; - }) - ; - py::classh(m, "Glyph", py::is_final(), PyGlyph__doc__) .def(py::init<>([]() -> PyGlyph { // Glyph is not useful from Python, so mark it as not constructible. @@ -1897,18 +1845,7 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used()) .def_buffer([](PyFT2Font &self) -> py::buffer_info { return self.get_image().request(); - }) - - .def("_render_glyph", - [ft2Library](PyFT2Font *self, FT_UInt idx, LoadFlags flags, - FT_Render_Mode render_mode) - { - auto glyph = self->render_glyph( - idx, static_cast(flags), render_mode); - return PyPositionedBitmap{ - ft2Library, reinterpret_cast(glyph.get())}; - }) - ; + }); m.def("_render_glyph_run", [ft2Library](py::sequence glyphs, double dpi, double x, double y, double angle, From 2f701fd4ce6c73802a0f6efa698e178061709ab1 Mon Sep 17 00:00:00 2001 From: Qianye Su <976113615@qq.com> Date: Thu, 1 Oct 2026 18:58:26 +0800 Subject: [PATCH 068/210] DOC: clarify GUI embedding figure creation --- galleries/examples/user_interfaces/GALLERY_HEADER.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/galleries/examples/user_interfaces/GALLERY_HEADER.rst b/galleries/examples/user_interfaces/GALLERY_HEADER.rst index 75b469da7cf6..04038dc12cde 100644 --- a/galleries/examples/user_interfaces/GALLERY_HEADER.rst +++ b/galleries/examples/user_interfaces/GALLERY_HEADER.rst @@ -7,7 +7,8 @@ You can embed Matplotlib directly into a user interface application by following the embedding_in_SOMEGUI.py examples here. Currently Matplotlib supports PyQt/PySide, PyGObject, Tkinter, and wxPython. -When embedding Matplotlib in a GUI, you must use the Matplotlib API -directly rather than the pylab/pyplot procedural interface, so take a -look at the examples/api directory for some example code working with -the API. +When embedding Matplotlib in a GUI, use the Matplotlib API directly. For most +GUI integrations, this means creating standalone figure objects via +``fig = Figure()`` rather than using pyplot-managed figures such as +``plt.figure()`` or ``plt.subplots()``. The examples below show how to connect +these figures to the supported GUI toolkits. From b81e4af792b60d9fef7a2f774b540974a9050a0e Mon Sep 17 00:00:00 2001 From: Qianye Su <976113615@qq.com> Date: Thu, 1 Oct 2026 19:25:11 +0800 Subject: [PATCH 069/210] DOC: clarify GridSpec ratio updates --- lib/matplotlib/gridspec.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/matplotlib/gridspec.py b/lib/matplotlib/gridspec.py index 5cd05bc167bb..9bfe54eb2194 100644 --- a/lib/matplotlib/gridspec.py +++ b/lib/matplotlib/gridspec.py @@ -104,6 +104,15 @@ def set_width_ratios(self, width_ratios): *width_ratios* must be of length *ncols*. Each column gets a relative width of ``width_ratios[i] / sum(width_ratios)``. + + Notes + ----- + If Axes have already been created from this GridSpec, this method only + updates the ratios stored by the GridSpec. Existing Axes are not + repositioned automatically. To apply the new ratios to existing + Axes, use a layout engine (for example, ``Figure(layout="constrained")``) + or re-evaluate each Axes' SubplotSpec with + ``ax.set_subplotspec(ax.get_subplotspec())``. """ if width_ratios is None: width_ratios = [1] * self._ncols @@ -126,6 +135,15 @@ def set_height_ratios(self, height_ratios): *height_ratios* must be of length *nrows*. Each row gets a relative height of ``height_ratios[i] / sum(height_ratios)``. + + Notes + ----- + If Axes have already been created from this GridSpec, this method only + updates the ratios stored by the GridSpec. Existing Axes are not + repositioned automatically. To apply the new ratios to existing + Axes, use a layout engine (for example, ``Figure(layout="constrained")``) + or re-evaluate each Axes' SubplotSpec with + ``ax.set_subplotspec(ax.get_subplotspec())``. """ if height_ratios is None: height_ratios = [1] * self._nrows From 94ccc1dc6cd838269b96f31d5f09305ff7fec290 Mon Sep 17 00:00:00 2001 From: Qianye Su <976113615@qq.com> Date: Thu, 1 Oct 2026 20:04:03 +0800 Subject: [PATCH 070/210] DOC: clarify pyplot avoidance in GUI embedding --- galleries/examples/user_interfaces/GALLERY_HEADER.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/galleries/examples/user_interfaces/GALLERY_HEADER.rst b/galleries/examples/user_interfaces/GALLERY_HEADER.rst index 04038dc12cde..defbcc8a6fea 100644 --- a/galleries/examples/user_interfaces/GALLERY_HEADER.rst +++ b/galleries/examples/user_interfaces/GALLERY_HEADER.rst @@ -7,8 +7,9 @@ You can embed Matplotlib directly into a user interface application by following the embedding_in_SOMEGUI.py examples here. Currently Matplotlib supports PyQt/PySide, PyGObject, Tkinter, and wxPython. -When embedding Matplotlib in a GUI, use the Matplotlib API directly. For most -GUI integrations, this means creating standalone figure objects via -``fig = Figure()`` rather than using pyplot-managed figures such as -``plt.figure()`` or ``plt.subplots()``. The examples below show how to connect -these figures to the supported GUI toolkits. +When embedding Matplotlib in a GUI, use standalone `.Figure` objects only. +Do not use pyplot, because you do not want to depend on its globally managed +state and its event loop control. In particular, use ``fig = Figure()`` rather +than ``plt.figure()``, and ``fig = Figure(); axs = fig.subplots()`` rather than +``fig, axs = plt.subplots()``. The examples below show how to connect these +figures to the supported GUI toolkits. From 80a979a0d097a5d4d12be47f38703159a002a12a Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Thu, 1 Oct 2026 20:15:33 +0530 Subject: [PATCH 071/210] doc: fix typo in axis_api.rst --- doc/api/axis_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/axis_api.rst b/doc/api/axis_api.rst index 388779c0ebc5..2c9a94d5bf65 100644 --- a/doc/api/axis_api.rst +++ b/doc/api/axis_api.rst @@ -230,7 +230,7 @@ Discouraged These methods should be used together with care, calling ``set_ticks`` to specify the desired tick locations **before** calling ``set_ticklabels`` to specify a matching series of labels. Calling ``set_ticks`` makes a -`~matplotlib.ticker.FixedLocator`; it's list of locations is then used by +`~matplotlib.ticker.FixedLocator`; its list of locations is then used by ``set_ticklabels`` to make an appropriate `~matplotlib.ticker.FuncFormatter`. From 00121677447115a4a4e3c6da9d0c6a100582c6cf Mon Sep 17 00:00:00 2001 From: Mohd Maaz Khan Date: Thu, 1 Oct 2026 20:19:53 +0530 Subject: [PATCH 072/210] doc: fix broken qt reference in backend_qt_api.rst --- doc/api/backend_qt_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/backend_qt_api.rst b/doc/api/backend_qt_api.rst index 2f950adb672a..a7059207c4cf 100644 --- a/doc/api/backend_qt_api.rst +++ b/doc/api/backend_qt_api.rst @@ -28,7 +28,7 @@ Python binding for Qt5 and there are both `PyQt6 `_ and `PySide6 `_ for Qt6 [#]_. Matplotlib's qtagg and qtcairo backends (``matplotlib.backends.backend_qtagg`` and -``matplotlib.backend.backend_qtcairo``) support all these bindings, with common +``matplotlib.backends.backend_qtcairo``) support all these bindings, with common parts factored out in the ``matplotlib.backends.backend_qt`` module. At runtime, these backends select the actual binding used as follows: From 6c6cbd1c73ee9553af4bf118cfa8a12ae3c9a7b2 Mon Sep 17 00:00:00 2001 From: RYAN AKMAL PASYA Date: Thu, 1 Oct 2026 23:22:10 +0700 Subject: [PATCH 073/210] DOC: synchronize Axes.margins docs with set_xmargin/set_ymargin --- lib/matplotlib/axes/_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 653b353ac9c0..bc1f1dbf0f61 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2871,6 +2871,13 @@ def margins(self, *margins, x=None, y=None, tight=True): .. plot:: _embedded_plots/axes_margins.py + The margin is a fraction of the data interval: *margin* times the + data interval is added to each end of that interval before it is + used in autoscaling. If the margin is negative, the data range is + clipped instead of expanded. For example, if your data is in the + range [0, 2], a margin of 0.1 will result in a range [-0.2, 2.2]; + a margin of -0.1 will result in a range of [0.2, 1.8]. + All input parameters must be floats greater than -0.5. Passing both positional and keyword arguments is invalid and will raise a TypeError. If no arguments (positional or otherwise) are provided, the current @@ -2917,6 +2924,7 @@ def margins(self, *margins, x=None, y=None, tight=True): -------- :ref:`autoscale_margins` .Axes.set_xmargin, .Axes.set_ymargin + .Axes.set_xlim, .Axes.set_ylim """ if margins and (x is not None or y is not None): From 266c9a38d67aee6c8578987209f9f4e83c0d3a45 Mon Sep 17 00:00:00 2001 From: Ricci Adams <1097294+iccir@users.noreply.github.com> Date: Thu, 1 Oct 2026 10:16:50 -0700 Subject: [PATCH 074/210] Use already-converted np.arrays (#32417) --- lib/matplotlib/tri/_triangulation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tri/_triangulation.py b/lib/matplotlib/tri/_triangulation.py index a07192dfc8ca..c6434a568465 100644 --- a/lib/matplotlib/tri/_triangulation.py +++ b/lib/matplotlib/tri/_triangulation.py @@ -57,7 +57,8 @@ def __init__(self, x, y, triangles=None, mask=None): if triangles is None: # No triangulation specified, so use matplotlib._qhull to obtain # Delaunay triangulation. - self.triangles, self._neighbors = _qhull.delaunay(x, y, sys.flags.verbose) + self.triangles, self._neighbors = _qhull.delaunay(self.x, self.y, + sys.flags.verbose) self.is_delaunay = True else: # Triangulation specified. Copy, since we may correct triangle From 27d5d426c786a83851fdc820ead4c6c3c9be7156 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 2 Oct 2026 21:17:02 +0200 Subject: [PATCH 075/210] MNT: Refactor to make colorbar Axes patching more clear --- lib/matplotlib/colorbar.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index 100807dd7f18..c787889e796e 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -426,13 +426,7 @@ def __init__( isinstance(self.mappable, contour.ContourSet)): self.ax.set_navigate(False) - # These are the functions that set up interactivity on this colorbar - self._interactive_funcs = ["_get_view", "_set_view", - "_set_view_from_bbox", "drag_pan"] - for x in self._interactive_funcs: - setattr(self.ax, x, getattr(self, x)) - # Set the cla function to the cbar's method to override it - self.ax.cla = self._cbar_cla + self._patch_ax_methods() # Callbacks for the extend calculations to handle inverting the axis self._extend_cid1 = self.ax.callbacks.connect( "xlim_changed", self._do_extends) @@ -447,6 +441,24 @@ def __init__( self._ax_remove = self.ax._remove_method self.ax._remove_method = functools.partial(_remove_cbar_axes, cbar=self) + def _patch_ax_methods(self): + """Override Axes methods because colorbars behave slightly different.""" + # These are the functions that set up interactivity on this colorbar + self._interactive_funcs = ["_get_view", "_set_view", + "_set_view_from_bbox", "drag_pan"] + for x in self._interactive_funcs: + setattr(self.ax, x, getattr(self, x)) + # Override cla Set the cla function to the cbar's method to override it + self.ax.cla = self._cbar_cla + + def _cbar_cla(self): + """Function to clear the interactive colorbar state.""" + for x in self._interactive_funcs: + delattr(self.ax, x) + # We now restore the old cla() back and can call it directly + del self.ax.cla + self.ax.cla() + @property def long_axis(self): """Axis that has decorations (ticks, etc) on it.""" @@ -494,14 +506,6 @@ def minorformatter(self, fmt): self.long_axis.set_minor_formatter(fmt) self._minorformatter = fmt - def _cbar_cla(self): - """Function to clear the interactive colorbar state.""" - for x in self._interactive_funcs: - delattr(self.ax, x) - # We now restore the old cla() back and can call it directly - del self.ax.cla - self.ax.cla() - def update_normal(self, mappable=None): """ Update solid patches, lines, etc. From ec24da4f7a36d3408d0ed3f8d3b1d215f5205b7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2026 19:17:09 +0000 Subject: [PATCH 076/210] Bump the actions group with 2 updates Bumps the actions group with 2 updates: [github/codeql-action/init](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.38.1 to 4.38.2 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/1c5b675653bb5c22dbe9b12b556ec555138e09fd...2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2) Updates `github/codeql-action/analyze` from 4.38.1 to 4.38.2 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/1c5b675653bb5c22dbe9b12b556ec555138e09fd...2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.38.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/codeql-action/analyze dependency-version: 4.38.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 20141b3fdce8..1263d5a25250 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 + uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: languages: ${{ matrix.language }} @@ -45,4 +45,4 @@ jobs: pip install --user -v . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 + uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 From 5cb27e1ad17fe2feb1ff7636e22fb2de44f94944 Mon Sep 17 00:00:00 2001 From: Gabriel Luca Date: Sat, 3 Oct 2026 23:34:51 +0100 Subject: [PATCH 077/210] DOC: Fix link to new contributors meeting notes --- doc/devel/contribute.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/devel/contribute.rst b/doc/devel/contribute.rst index b409d0b7bd72..83e6992cdc39 100644 --- a/doc/devel/contribute.rst +++ b/doc/devel/contribute.rst @@ -248,7 +248,7 @@ veteran contributors, who are keen to support onboarding of new folks and share their experience. You can find our community calendar link at the `Scientific Python website `_, and you can browse previous meeting notes on `GitHub -`_. +`_. We recommend joining the meeting to clarify any doubts, or lingering questions you might have, and to get to know a few of the people behind the GitHub handles 😉. You can reach out to us on `incubator chat`_ for any From 62d0968e1ad1d5fb7e87c5d42d1854cc2c4b8faa Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 4 Oct 2026 12:16:39 +0200 Subject: [PATCH 078/210] DOC: Improve docs of contour-related rcParams --- lib/matplotlib/rcsetup.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 8c0b304c9bc0..153b9a12e0b1 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3224,35 +3224,42 @@ class _Subsection: "single composite image before saving a figure as a vector " "graphics file, such as a PDF." ), - _Section("Contour plots"), + _Section( + "Contour plots", + description="Default settings for `~.Axes.contour` / `~.Axes.contourf`. " + "See the description of its parameters for details." + ), + _Param( "contour.negative_linestyle", default="dashed", type=_LineStyleType, validator=_validate_linestyle, - description="string or on-off ink sequence" + description="The line style for negative contours, if *linestyle* is None " + "and no color is specified." ), _Param( "contour.corner_mask", default=True, type=bool, validator=validate_bool, - description="{True, False}" + description="Enable/disable corner masking. See the *corner_mask* parameter " + "of `~.Axes.contour` for details." ), _Param( "contour.linewidth", default=None, type=float | None, validator=validate_float_or_None, - description="{float, None} Size of the contour line widths. If set to None, it " - 'falls back to "line.linewidth".' + description="Size of the contour line widths. If None, falls back to " + '"lines.linewidth".' ), _Param( "contour.algorithm", default="mpl2014", type=Literal["mpl2005", "mpl2014", "serial", "threaded"], validator=["mpl2005", "mpl2014", "serial", "threaded"], - description="{mpl2005, mpl2014, serial, threaded}" + description="The contouring algorithm used to calculate the contour lines." ), _Section("Errorbar plots"), _Param( From d8486c5e9a1e557d71b8645d182f96caf80511c4 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Sun, 4 Oct 2026 23:21:11 +0000 Subject: [PATCH 079/210] doc: fix typos in dev docs --- doc/devel/development_setup.rst | 2 +- doc/devel/document.rst | 4 ++-- doc/devel/min_dep_policy.rst | 2 +- doc/devel/pr_guide.rst | 2 +- doc/devel/testing.rst | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/devel/development_setup.rst b/doc/devel/development_setup.rst index c683c54c867e..a5d005956f16 100644 --- a/doc/devel/development_setup.rst +++ b/doc/devel/development_setup.rst @@ -326,7 +326,7 @@ Install git pre-commit hooks `prek `_ hooks save time in the review process by identifying issues with the code before a pull request is formally opened. Most -hooks can also aide in fixing the errors, and the checks should have +hooks can also aid in fixing the errors, and the checks should have corresponding :ref:`development workflow ` and :ref:`pull request ` guidelines. Hooks are configured in `.pre-commit-config.yaml `_ diff --git a/doc/devel/document.rst b/doc/devel/document.rst index 748d54f43b30..8b66bd588548 100644 --- a/doc/devel/document.rst +++ b/doc/devel/document.rst @@ -318,7 +318,7 @@ before the section Summary for pull request authors ================================ -and then link to with ``:ref:`label-name``` +and then link to it with ``:ref:`label-name``` .. code-block:: rst @@ -396,7 +396,7 @@ commands:: Include figures and files ------------------------- -Image files can directly included in pages with the ``image::`` directive. +Image files can directly be included in pages with the ``image::`` directive. e.g., :file:`tutorials/intermediate/constrainedlayout_guide.py` displays a couple of static images:: diff --git a/doc/devel/min_dep_policy.rst b/doc/devel/min_dep_policy.rst index f0dc0438c8e4..ca0cdd5c6c6e 100644 --- a/doc/devel/min_dep_policy.rst +++ b/doc/devel/min_dep_policy.rst @@ -66,7 +66,7 @@ Test and documentation dependencies As these packages are only needed for testing or building the docs and not needed by end-users, we can be more aggressive about dropping support for old versions. However, we need to be careful to not -over-run what down-stream packagers support (as most of the run the +over-run what down-stream packagers support (as most of them run the tests and build the documentation as part of the packaging process). We will support at least minor versions of the development dependencies diff --git a/doc/devel/pr_guide.rst b/doc/devel/pr_guide.rst index b0f36f2e78b0..1fe5a1fae82d 100644 --- a/doc/devel/pr_guide.rst +++ b/doc/devel/pr_guide.rst @@ -360,7 +360,7 @@ Automated backports ------------------- We use MeeseeksDev bot to automatically backport merges to the correct -maintenance branch base on the milestone. To work properly the +maintenance branch based on the milestone. To work properly the milestone must be set before merging. If you have commit rights, the bot can also be manually triggered after a merge by leaving a message ``@meeseeksdev backport to BRANCH`` on the PR. If there are conflicts diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index 27594ffe7dd4..48d994f7c7f6 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -289,7 +289,7 @@ CI with GitHub Actions "in the cloud". GitHub Actions is configured to receive notifications of new commits to GitHub -repos and to run builds or tests when it sees these new commits. It looks for a +repos and to run builds or tests when it sees these new commits. It looks for YAML files in ``.github/workflows`` to see how to test the project. GitHub Actions is already enabled for the `main Matplotlib GitHub repository @@ -384,7 +384,7 @@ To do so, either download the matching source distribution ``matplotlib-X.Y.Z.tar.gz`` from `PyPI `_ or alternatively, clone the git repository and ``git checkout vX.Y.Z``. Copy the folder :file:`lib/matplotlib/tests/baseline_images` to the folder -:file:`matplotlib/tests` of your the matplotlib installation to test. +:file:`matplotlib/tests` of the matplotlib installation to test. The correct target folder can be found using:: python -c "import matplotlib.tests; print(matplotlib.tests.__file__.rsplit('/', 1)[0])" From 55ebdbd367fdabc81e9d78e7051749cfc7c708a1 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Mon, 5 Oct 2026 00:01:42 +0000 Subject: [PATCH 080/210] doc: remove trailing whitespace in testing.rst --- doc/devel/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index 48d994f7c7f6..3d2e6264a732 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -289,7 +289,7 @@ CI with GitHub Actions "in the cloud". GitHub Actions is configured to receive notifications of new commits to GitHub -repos and to run builds or tests when it sees these new commits. It looks for +repos and to run builds or tests when it sees these new commits. It looks for YAML files in ``.github/workflows`` to see how to test the project. GitHub Actions is already enabled for the `main Matplotlib GitHub repository From e2d2eba5200b60eafe08048e7abd39f38f33af17 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:39:22 +0200 Subject: [PATCH 081/210] MNT: Make bar() error handling independent of numpy error message as proposed in https://github.com/matplotlib/matplotlib/pull/32431#issuecomment-5996182478 --- lib/matplotlib/axes/_axes.py | 34 ++++++++++++++----------------- lib/matplotlib/tests/test_axes.py | 3 ++- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 276d7b61b852..411fc34f14b1 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2520,27 +2520,23 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", height = self._convert_dx(height, y0, y, self.convert_yunits) if yerr is not None: yerr = self._convert_dx(yerr, y0, y, self.convert_yunits) + + # broadcast all args to make them iterable + x = np.atleast_1d(x) + args = (x, height, width, y, linewidth, hatch) + arg_names = ('x', 'height', 'width', 'y', 'linewidth', 'hatch') try: - x, height, width, y, linewidth, hatch = np.broadcast_arrays( - # Make args iterable too. - np.atleast_1d(x), height, width, y, linewidth, hatch - ) + x, height, width, y, linewidth, hatch = np.broadcast_arrays(*args) except ValueError as e: - arg_map = { - "arg 0": "'x'", - "arg 1": "'height'", - "arg 2": "'width'", - "arg 3": "'y'", - "arg 4": "'linewidth'", - "arg 5": "'hatch'" - } - error_message = str(e) - for arg, name in arg_map.items(): - error_message = error_message.replace(arg, name) - if error_message != str(e): - raise ValueError(error_message) from e - else: - raise + non_trivial_inputs = ", ".join( + f"{name} {np.shape(arg)}" for arg, name in zip(args, arg_names) + # only collect args that could contribute to a broadcast error + if any(dim != 1 for dim in np.shape(arg)) + ) + raise ValueError( + f"bar() failed on broadcasting inputs with the following shapes: " + f"{non_trivial_inputs}" + ) from e # Now that units have been converted, set the tick locations. if orientation == 'vertical': diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 531eae23db30..4f122068a84f 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -10411,7 +10411,8 @@ def test_bar_shape_mismatch(): x = ["foo", "bar"] height = [1, 2, 3] error_message = ( - r"Mismatch is between 'x' with shape \(2,\) and 'height' with shape \(3,\)" + r"bar\(\) failed on broadcasting inputs with the following shapes: " + r"x \(2,\), height \(3,\)" ) with pytest.raises(ValueError, match=error_message): plt.bar(x, height) From e8eebffcc49cce378ef0851c1d3c59e9d36b2130 Mon Sep 17 00:00:00 2001 From: Ricci Adams <1097294+iccir@users.noreply.github.com> Date: Tue, 6 Oct 2026 03:52:09 -0700 Subject: [PATCH 082/210] Remove print() from test_agg_filter_alpha (#32439) * Remove print() from test * Add mock to ensure manual_alpha called --- lib/matplotlib/tests/test_agg_filter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_agg_filter.py b/lib/matplotlib/tests/test_agg_filter.py index 4c5b55a3d15c..8d88e715f5a7 100644 --- a/lib/matplotlib/tests/test_agg_filter.py +++ b/lib/matplotlib/tests/test_agg_filter.py @@ -2,6 +2,7 @@ import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison +from unittest.mock import Mock @image_comparison(baseline_images=['agg_filter_alpha'], @@ -14,17 +15,21 @@ def test_agg_filter_alpha(): def manual_alpha(im, dpi): im[:, :, 3] *= 0.6 - print('CALLED') return im, 0, 0 + wrapped_manual_alpha = Mock(wraps=manual_alpha) + # Note: Doing alpha like this is not the same as setting alpha on # the mesh itself. Currently meshes are drawn as independent patches, # and we see fine borders around the blocks of color. See the SO # question for an example: https://stackoverflow.com/q/20678817/ - mesh.set_agg_filter(manual_alpha) + mesh.set_agg_filter(wrapped_manual_alpha) # Currently we must enable rasterization for this to have an effect in # the PDF backend. mesh.set_rasterized(True) ax.plot([0, 4, 7], [1, 3, 8]) + ax.figure.canvas.draw() + + wrapped_manual_alpha.assert_called() From b209efabfad74e2b1d255eadef2e9a74e06e1af2 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 7 Oct 2026 00:54:42 +0200 Subject: [PATCH 083/210] DOC: Improve rcParams descriptions --- lib/matplotlib/rcsetup.py | 475 +++++++++++++++++++++++--------------- 1 file changed, 289 insertions(+), 186 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 153b9a12e0b1..e1dce9676a7e 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1637,131 +1637,133 @@ class _Subsection: default=1.5, type=float, validator=validate_float, - description="line width in points" + description="The default line width in points." ), _Param( "lines.linestyle", default="-", type=_LineStyleType, validator=_validate_linestyle, - description="solid line" + description="The default line style." ), _Param( "lines.color", default="C0", type=":mpltype:`color`", validator=validate_color, - description="has no affect on plot(); see axes.prop_cycle" + description="The default line color." ), _Param( "lines.marker", default="None", type=_MarkerType, validator=_validate_marker, - description="the default marker" + description="The default marker type." ), _Param( "lines.markerfacecolor", default="auto", type=':mpltype:`color` or "auto"', validator=validate_color_or_auto, - description="the default marker face color" + description="The default marker face color; use 'auto' to use 'lines.color'.", ), _Param( "lines.markeredgecolor", default="auto", type=':mpltype:`color` or "auto"', validator=validate_color_or_auto, - description="the default marker edge color" + description="The default marker edge color; use 'auto' to use 'lines.color'." ), _Param( "lines.markeredgewidth", default=1.0, type=float, validator=validate_float, - description="the line width around the marker symbol" + description="The default width of the marker edge stroke, in points." ), _Param( "lines.markersize", default=6.0, type=float, validator=validate_float, - description="marker size, in points" + description="The default marker size, in points." ), _Param( "lines.dash_joinstyle", default="round", type=JoinStyle, validator=JoinStyle, - description="{miter, round, bevel}" + description="The join style used where dashed line segments meet." ), _Param( "lines.dash_capstyle", default="butt", type=CapStyle, validator=CapStyle, - description="{butt, round, projecting}" + description="The cap style used at the ends of dashed line segments." ), _Param( "lines.solid_joinstyle", default="round", type=JoinStyle, validator=JoinStyle, - description="{miter, round, bevel}" + description="The join style used where solid line segments meet." ), _Param( "lines.solid_capstyle", default="projecting", type=CapStyle, validator=CapStyle, - description="{butt, round, projecting}" + description="The cap style used at the ends of solid lines." ), _Param( "lines.antialiased", default=True, type=bool, validator=validate_bool, - description="render lines in antialiased (no jaggies)" + description="Whether to render lines with antialiasing." ), _Param( "lines.dashed_pattern", default=[3.7, 1.6], type=list[float], validator=validate_floatlist, - description="The dash pattern for linestyle 'dashed'" + description="The dash pattern for linestyle 'dashed'." ), _Param( "lines.dashdot_pattern", default=[6.4, 1.6, 1.0, 1.6], type=list[float], validator=validate_floatlist, - description="The dash pattern for linestyle 'dashdot'" + description="The dash pattern for linestyle 'dashdot'." ), _Param( "lines.dotted_pattern", default=[1.0, 1.65], type=list[float], validator=validate_floatlist, - description="The dash pattern for linestyle 'dotted'" + description="The dash pattern for linestyle 'dotted'." ), _Param( "lines.scale_dashes", default=True, type=bool, validator=validate_bool, + description="Whether dash lengths are scaled by the line width." ), _Param( "markers.fillstyle", default="full", type=Literal["full", "left", "right", "bottom", "top", "none"], validator=validate_fillstyle, - description="{full, left, right, bottom, top, none}" + description="The marker fill style." ), _Param( "pcolor.shading", default="auto", type=Literal["auto", "flat", "nearest", "gouraud"], - validator=["auto", "flat", "nearest", "gouraud"] + validator=["auto", "flat", "nearest", "gouraud"], + description="The default shading mode for `.pcolor` and `.pcolormesh`." ), _Param( "pcolormesh.snap", @@ -1778,13 +1780,14 @@ class _Subsection: default=1.0, type=float, validator=validate_float, - description="edge width in points." + description="The patch edge width, in points." ), _Param( "patch.facecolor", default="C0", type=':mpltype:`color`', - validator=validate_color + validator=validate_color, + description="The patch face color." ), _Param( "patch.edgecolor", @@ -1802,7 +1805,7 @@ class _Subsection: type=bool, validator=validate_bool, description="By default, Patches and Collections do not draw edges. Set this " - "to True to draw edges with patch.edgedcolor as the default " + "to True to draw edges with patch.edgecolor as the default " "edgecolor. This is mainly relevant for styles." ), _Param( @@ -1810,54 +1813,89 @@ class _Subsection: default=True, type=bool, validator=validate_bool, - description="render patches in antialiased (no jaggies)" + description="Whether to render patches with antialiasing." ), _Section("Hatches"), _Param("hatch.color", "edge", ':mpltype:`color` or "edge"', - _validate_color_or_edge), - _Param("hatch.linewidth", 1.0, float, validate_float), + _validate_color_or_edge, description="The color used for hatch strokes."), + _Param("hatch.linewidth", 1.0, float, validate_float, + description="The width of hatch strokes, in points."), _Section("Boxplot"), - _Param("boxplot.notch", False, bool, validate_bool), - _Param("boxplot.vertical", True, bool, validate_bool), - _Param("boxplot.whiskers", 1.5, float | tuple[float, float], validate_whiskers), - _Param("boxplot.bootstrap", None, int | None, validate_int_or_None), - _Param("boxplot.patchartist", False, bool, validate_bool), - _Param("boxplot.showmeans", False, bool, validate_bool), - _Param("boxplot.showcaps", True, bool, validate_bool), - _Param("boxplot.showbox", True, bool, validate_bool), - _Param("boxplot.showfliers", True, bool, validate_bool), - _Param("boxplot.meanline", False, bool, validate_bool), - _Param("boxplot.flierprops.color", "black", ":mpltype:`color`", validate_color), - _Param("boxplot.flierprops.marker", "o", _MarkerType, _validate_marker), + _Param("boxplot.notch", False, bool, validate_bool, + description="Whether to draw notches around the median."), + _Param("boxplot.vertical", True, bool, validate_bool, + description="Whether to draw vertical boxplots."), + _Param("boxplot.whiskers", 1.5, float | tuple[float, float], validate_whiskers, + description="The whisker length as a multiple of the interquartile range, or a (lower, upper) pair."), + _Param("boxplot.bootstrap", None, int | None, validate_int_or_None, + description="The number of bootstrap resamples used to estimate boxplot notches; None disables bootstrapping."), + _Param("boxplot.patchartist", False, bool, validate_bool, + description="Whether boxplots should be drawn as patches instead of line artists."), + _Param("boxplot.showmeans", False, bool, validate_bool, + description="Whether to draw the mean on boxplots."), + _Param("boxplot.showcaps", True, bool, validate_bool, + description="Whether to draw caps on the whiskers."), + _Param("boxplot.showbox", True, bool, validate_bool, + description="Whether to draw the box around the quartiles."), + _Param("boxplot.showfliers", True, bool, validate_bool, + description="Whether to draw flier markers for outliers."), + _Param("boxplot.meanline", False, bool, validate_bool, + description="Whether to draw the mean as a line instead of a marker."), + _Param("boxplot.flierprops.color", "black", ":mpltype:`color`", validate_color, + description="The color of the flier markers."), + _Param("boxplot.flierprops.marker", "o", _MarkerType, _validate_marker, + description="The marker style used for flier points."), _Param("boxplot.flierprops.markerfacecolor", "none", - ':mpltype:`color` or "auto"', validate_color_or_auto), + ':mpltype:`color` or "auto"', validate_color_or_auto, + description="The face color of flier markers."), _Param("boxplot.flierprops.markeredgecolor", "black", ':mpltype:`color`', - validate_color), - _Param("boxplot.flierprops.markeredgewidth", 1.0, float, validate_float), - _Param("boxplot.flierprops.markersize", 6.0, float, validate_float), - _Param("boxplot.flierprops.linestyle", "none", _LineStyleType, _validate_linestyle), - _Param("boxplot.flierprops.linewidth", 1.0, float, validate_float), - _Param("boxplot.boxprops.color", "black", ':mpltype:`color`', validate_color), - _Param("boxplot.boxprops.linewidth", 1.0, float, validate_float), - _Param("boxplot.boxprops.linestyle", "-", _LineStyleType, _validate_linestyle), - _Param("boxplot.whiskerprops.color", "black", ':mpltype:`color`', validate_color), - _Param("boxplot.whiskerprops.linewidth", 1.0, float, validate_float), - _Param("boxplot.whiskerprops.linestyle", "-", _LineStyleType, _validate_linestyle), - _Param("boxplot.capprops.color", "black", ':mpltype:`color`', validate_color), - _Param("boxplot.capprops.linewidth", 1.0, float, validate_float), - _Param("boxplot.capprops.linestyle", "-", _LineStyleType, _validate_linestyle), - _Param("boxplot.medianprops.color", "C1", ':mpltype:`color`', validate_color), - _Param("boxplot.medianprops.linewidth", 1.0, float, validate_float), - _Param("boxplot.medianprops.linestyle", "-", _LineStyleType, _validate_linestyle), - _Param("boxplot.meanprops.color", "C2", ':mpltype:`color`', validate_color), - _Param("boxplot.meanprops.marker", "^", _MarkerType, _validate_marker), + validate_color, description="The edge color of flier markers."), + _Param("boxplot.flierprops.markeredgewidth", 1.0, float, validate_float, + description="The width of the flier marker edge, in points."), + _Param("boxplot.flierprops.markersize", 6.0, float, validate_float, + description="The flier marker size, in points."), + _Param("boxplot.flierprops.linestyle", "none", _LineStyleType, _validate_linestyle, + description="The line style used for flier markers."), + _Param("boxplot.flierprops.linewidth", 1.0, float, validate_float, + description="The line width used for flier markers, in points."), + _Param("boxplot.boxprops.color", "black", ':mpltype:`color`', validate_color, + description="The box outline color."), + _Param("boxplot.boxprops.linewidth", 1.0, float, validate_float, + description="The box outline width, in points."), + _Param("boxplot.boxprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The box outline style."), + _Param("boxplot.whiskerprops.color", "black", ':mpltype:`color`', validate_color, + description="The whisker line color."), + _Param("boxplot.whiskerprops.linewidth", 1.0, float, validate_float, + description="The whisker line width, in points."), + _Param("boxplot.whiskerprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The whisker line style."), + _Param("boxplot.capprops.color", "black", ':mpltype:`color`', validate_color, + description="The cap line color."), + _Param("boxplot.capprops.linewidth", 1.0, float, validate_float, + description="The cap line width, in points."), + _Param("boxplot.capprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The cap line style."), + _Param("boxplot.medianprops.color", "C1", ':mpltype:`color`', validate_color, + description="The median line color."), + _Param("boxplot.medianprops.linewidth", 1.0, float, validate_float, + description="The median line width, in points."), + _Param("boxplot.medianprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The median line style."), + _Param("boxplot.meanprops.color", "C2", ':mpltype:`color`', validate_color, + description="The mean marker or line color."), + _Param("boxplot.meanprops.marker", "^", _MarkerType, _validate_marker, + description="The marker style used for the mean."), _Param("boxplot.meanprops.markerfacecolor", "C2", ':mpltype:`color`', - validate_color), + validate_color, description="The face color of the mean marker."), _Param("boxplot.meanprops.markeredgecolor", "C2", ':mpltype:`color`', - validate_color), - _Param("boxplot.meanprops.markersize", 6.0, float, validate_float), - _Param("boxplot.meanprops.linestyle", "--", _LineStyleType, _validate_linestyle), - _Param("boxplot.meanprops.linewidth", 1.0, float, validate_float), + validate_color, description="The edge color of the mean marker."), + _Param("boxplot.meanprops.markersize", 6.0, float, validate_float, + description="The mean marker size, in points."), + _Param("boxplot.meanprops.linestyle", "--", _LineStyleType, _validate_linestyle, + description="The line style used for the mean marker or line."), + _Param("boxplot.meanprops.linewidth", 1.0, float, validate_float, + description="The line width used for the mean marker or line, in points."), _Section( "Font", description="The font properties used by `.Text` " @@ -1865,12 +1903,19 @@ class _Subsection: "more information on font properties. The 6 font properties used " "for font matching are given below with their default values." ), - _Param("font.family", ["sans-serif"], list[str], validate_stringlist), - _Param("font.style", "normal", str, validate_string), - _Param("font.variant", "normal", str, validate_string), - _Param("font.weight", "normal", _FontWeightType, validator=validate_fontweight), - _Param("font.stretch", "normal", _FontStretchType, validator=validate_fontstretch), - _Param("font.size", 10.0, float, validate_float), + _Param("font.family", ["sans-serif"], list[str], validate_stringlist, + description="A prioritized list of font families to try."), + _Param("font.style", "normal", Literal["normal", "italic", "oblique"], + validate_string, + description="The default font style."), + _Param("font.variant", "normal", Literal["normal", "small-caps"], validate_string, + description="The default font variant."), + _Param("font.weight", "normal", _FontWeightType, validator=validate_fontweight, + description="The default font weight."), + _Param("font.stretch", "normal", _FontStretchType, validator=validate_fontstretch, + description="The default font stretch."), + _Param("font.size", 10.0, float, validate_float, + description="The default font size, in points."), _Param( "font.serif", default=[ @@ -1880,7 +1925,8 @@ class _Subsection: "Charter", "serif", ], type=list[str], - validator=validate_stringlist + validator=validate_stringlist, + description="Preferred serif font families." ), _Param( "font.sans-serif", @@ -1890,7 +1936,8 @@ class _Subsection: "Avant Garde", "sans-serif", ], type=list[str], - validator=validate_stringlist + validator=validate_stringlist, + description="Preferred sans-serif font families." ), _Param( "font.cursive", @@ -1899,13 +1946,15 @@ class _Subsection: "Comic Neue", "Comic Sans MS", "cursive", ], type=list[str], - validator=validate_stringlist + validator=validate_stringlist, + description="Preferred cursive font families." ), _Param( "font.fantasy", default=["Chicago", "Charcoal", "Impact", "Western", "xkcd script", "fantasy"], type=list[str], - validator=validate_stringlist + validator=validate_stringlist, + description="Preferred fantasy font families." ), _Param( "font.monospace", @@ -1915,7 +1964,8 @@ class _Subsection: "Courier", "Fixed", "Terminal", "monospace", ], type=list[str], - validator=validate_stringlist + validator=validate_stringlist, + description="Preferred monospace font families." ), _Param( "font.enable_last_resort", @@ -1932,6 +1982,7 @@ class _Subsection: default="black", type=":mpltype:`color`", validator=validate_color, + description="The default text color." ), _Param( "text.language", @@ -2053,13 +2104,20 @@ class _Subsection: description="Should be 'dejavusans' (default), 'dejavuserif', " "'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'" ), - _Param("mathtext.bf", "sans:bold", str, validate_font_properties), - _Param("mathtext.bfit", "sans:italic:bold", str, validate_font_properties), - _Param("mathtext.cal", "cursive", str, validate_font_properties), - _Param("mathtext.it", "sans:italic", str, validate_font_properties), - _Param("mathtext.rm", "sans", str, validate_font_properties), - _Param("mathtext.sf", "sans", str, validate_font_properties), - _Param("mathtext.tt", "monospace", str, validate_font_properties), + _Param("mathtext.bf", "sans:bold", str, validate_font_properties, + description="The font config pattern used for bold math text."), + _Param("mathtext.bfit", "sans:italic:bold", str, validate_font_properties, + description="The font config pattern used for bold italic math text."), + _Param("mathtext.cal", "cursive", str, validate_font_properties, + description="The font config pattern used for calligraphic math text."), + _Param("mathtext.it", "sans:italic", str, validate_font_properties, + description="The font config pattern used for italic math text."), + _Param("mathtext.rm", "sans", str, validate_font_properties, + description="The font config pattern used for roman math text."), + _Param("mathtext.sf", "sans", str, validate_font_properties, + description="The font config pattern used for sans-serif math text."), + _Param("mathtext.tt", "monospace", str, validate_font_properties, + description="The font config pattern used for monospace math text."), _Param( "mathtext.fallback", default="cm", @@ -2090,112 +2148,113 @@ class _Subsection: default="white", type=":mpltype:`color`", validator=validate_color, - description="axes background color" + description="The axes background color." ), _Param( "axes.edgecolor", default="black", type=":mpltype:`color`", validator=validate_color, - description="axes edge color" + description="The axes edge color." ), _Param( "axes.linewidth", default=0.8, type=float, validator=validate_float, - description="edge line width" + description="The axes edge line width." ), _Param( "axes.grid", default=False, type=bool, validator=validate_bool, - description="display grid or not" + description="Whether to display the grid." ), _Param( "axes.grid.axis", default="both", type=Literal["x", "y", "both"], validator=["x", "y", "both"], - description="which axis the grid should apply to" + description="Which axis the grid should apply to." ), _Param( "axes.grid.which", default="major", type=Literal["minor", "both", "major"], validator=["minor", "both", "major"], - description="grid lines at {major, minor, both} ticks" + description="Whether to draw grid lines at major ticks, minor ticks, or both." ), _Param( "axes.titlelocation", default="center", type=Literal["left", "center", "right"], validator=["left", "center", "right"], - description="alignment of the title: {left, right, center}" + description="The alignment of the axes title." ), _Param( "axes.titlesize", default="large", type=_FontSizeType, validator=validate_fontsize, - description="font size of the axes title" + description="The font size of the axes title." ), _Param( "axes.titleweight", default="normal", type=_FontWeightType, validator=validate_fontweight, - description="font weight of title" + description="The font weight of the axes title." ), _Param( "axes.titlecolor", default="auto", type=':mpltype:`color` or "auto"', validator=validate_color_or_auto, - description="color of the axes title, auto falls back to text.color as default " - "value" + description="The color of the axes title; auto falls back to 'text.color'." ), _Param( "axes.titley", default=None, type=float | None, validator=validate_float_or_None, - description="position title (axes relative units). None implies auto" + description="The title position in Axes-relative units; None enables" + "automatic placement." ), _Param( "axes.titlepad", default=6.0, type=float, validator=validate_float, - description="pad between axes and title in points" + description="The padding between the axes and title, in points." ), _Param( "axes.labelsize", default="medium", type=_FontSizeType, validator=validate_fontsize, - description="font size of the x and y labels" + description="The font size of the x and y labels." ), _Param( "axes.labelpad", default=4.0, type=float, validator=validate_float, - description="space between label and axis" + description="The space between the axis label and the axis, in points." ), _Param( "axes.labelweight", default="normal", type=_FontWeightType, validator=validate_fontweight, - description="weight of the x and y labels" + description="The font weight of the x and y labels." ), _Param( "axes.labelcolor", default="black", type=":mpltype:`color`", - validator=validate_color + validator=validate_color, + description="The color of the axis labels." ), _Param( "axes.axisbelow", @@ -2262,14 +2321,12 @@ class _Subsection: validator=validate_bool, description="display axis spines" ), - _Param("axes.spines.bottom", True, bool, validate_bool), - _Param("axes.spines.top", True, bool, validate_bool), - _Param( - "axes.spines.right", - default=True, - type=bool, - validator=validate_bool, - ), + _Param("axes.spines.bottom", True, bool, validate_bool, + description="Whether to draw the bottom axis spine."), + _Param("axes.spines.top", True, bool, validate_bool, + description="Whether to draw the top axis spine."), + _Param("axes.spines.right", True, bool, validate_bool, + description="Whether to draw the right axis spine."), _Param( "axes.unicode_minus", default=True, @@ -2295,7 +2352,8 @@ class _Subsection: (0.7372549019607844, 0.7411764705882353, 0.13333333333333333), (0.09019607843137255, 0.7450980392156863, 0.8117647058823529)], ), - validator=validate_cycler + validator=validate_cycler, + description="The cycler used to cycle through line colors and other artist properties." ), _Param( "axes.xmargin", @@ -2437,13 +2495,34 @@ class _Subsection: "https://matplotlib.org/stable/api/dates_api.html#date-formatters " "for more information." ), - _Param("date.autoformatter.year", "%Y", str, validate_string), - _Param("date.autoformatter.month", "%Y-%m", str, validate_string), - _Param("date.autoformatter.day", "%Y-%m-%d", str, validate_string), - _Param("date.autoformatter.hour", "%m-%d %H", str, validate_string), - _Param("date.autoformatter.minute", "%d %H:%M", str, validate_string), - _Param("date.autoformatter.second", "%H:%M:%S", str, validate_string), - _Param("date.autoformatter.microsecond", "%M:%S.%f", str, validate_string), + _Param( + "date.autoformatter.year", "%Y", str, validate_string, + description="The strftime format used for year ticks." + ), + _Param( + "date.autoformatter.month", "%Y-%m", str, validate_string, + description="The strftime format used for month ticks." + ), + _Param( + "date.autoformatter.day", "%Y-%m-%d", str, validate_string, + description="The strftime format used for day ticks." + ), + _Param( + "date.autoformatter.hour", "%m-%d %H", str, validate_string, + description="The strftime format used for hour ticks." + ), + _Param( + "date.autoformatter.minute", "%d %H:%M", str, validate_string, + description="The strftime format used for minute ticks." + ), + _Param( + "date.autoformatter.second", "%H:%M:%S", str, validate_string, + description="The strftime format used for second ticks." + ), + _Param( + "date.autoformatter.microsecond", "%M:%S.%f", str, validate_string, + description="The strftime format used for microsecond ticks." + ), _Param( "date.epoch", default="1970-01-01T00:00:00", @@ -2457,14 +2536,15 @@ class _Subsection: default="auto", type=Literal["auto", "concise"], validator=["auto", "concise"], - description="'auto', 'concise'" + description="The date converter to use." ), _Param( "date.interval_multiples", default=True, type=bool, validator=validate_bool, - description="For auto converter whether to use interval_multiples" + description="Whether the automatic date converter should use " + "interval_multiples." ), _Section("Ticks"), _Param( @@ -2767,28 +2847,29 @@ class _Subsection: default="#b0b0b0", type=":mpltype:`color`", validator=validate_color, - description='b0b0b0" # grid color' + description="The default grid line color." ), _Param( "grid.linestyle", default="-", type=_LineStyleType, validator=_validate_linestyle, - description="solid" + description="The default grid line style." ), _Param( "grid.linewidth", default=0.8, type=float, validator=validate_float, - description="in points" + description="The default grid line width, in points." ), _Param( "grid.alpha", default=1.0, type=float, validator=validate_float, - description="transparency, between 0.0 and 1.0" + description="The default grid line transparency, between 0.0 (fully " + "transparent) and 1.0 (opaque)." ), _Param( "grid.major.color", @@ -2851,7 +2932,8 @@ class _Subsection: "legend.loc", default="best", type=str | int | tuple[float, float], - validator=_validate_legend_loc + validator=_validate_legend_loc, + description="The legend location. See the *loc* parameter in `.Axes.legend`." ), _Param( "legend.frameon", @@ -2929,13 +3011,17 @@ class _Subsection: "legend.fontsize", default="medium", type=_FontSizeType, - validator=validate_fontsize + validator=validate_fontsize, + description="The font size of legend text." ), _Param( "legend.labelcolor", default="None", type=':mpltype:`color` or {"linecolor", "markerfacecolor", "markeredgecolor"}', - validator=_validate_color_or_linecolor + validator=_validate_color_or_linecolor, + description='The color of legend text; use "linecolor", "markerfacecolor", ' + 'or "markeredgecolor" line- or marker-based colors to ' + 'follow the respective color of the legend handle.' ), _Param( "legend.title_fontsize", @@ -3173,47 +3259,52 @@ class _Subsection: default="equal", type=Literal["equal", "auto"] | float, validator=validate_aspect, - description="{equal, auto} or a number" + description="The default image aspect ratio." ), _Param( "image.interpolation", default="auto", type=str, validator=validate_string, - description="see help(imshow) for options" + description="The default interpolation method for images; see `.Axes. imshow` " + "for details.", ), _Param( "image.interpolation_stage", default="auto", type=Literal["auto", "data", "rgba"], validator=["auto", "data", "rgba"], - description="see help(imshow) for options" + description="The stage at which image interpolation is applied; " + "see `.Axes. imshow` for details.", ), _Param( "image.cmap", default="viridis", type="str or Colormap", validator=_validate_cmap, - description="A colormap name (plasma, magma, etc.)" + description="The default colormap." ), _Param( "image.lut", default=256, type=int, validator=validate_int, - description="the size of the colormap lookup table" + description="The default size of the colormap lookup table. For each colormap, " + "this is determined at creation time." ), _Param( "image.origin", default="upper", type=Literal["upper", "lower"], - validator=["upper", "lower"], description="{lower, upper}" + validator=["upper", "lower"], + description="The default image origin." ), _Param( "image.resample", default=True, type=bool, validator=validate_bool, + description="Whether to resample images when drawing." ), _Param( "image.composite_image", @@ -3267,20 +3358,20 @@ class _Subsection: default=0.0, type=float, validator=validate_float, - description="length of end cap on error bars in pixels" + description="The length of error bar caps, in pixels." ), _Param( "errorbar.capthick", default=None, type=float | None, validator=validate_float_or_None, - description="thickness of end cap on error bars in points."), + description="The thickness of error bar caps, in points."), _Param( "errorbar.elinewidth", default=None, type=float | None, validator=validate_float_or_None, - description="line width of the error bar lines in points." + description="The line width of the error bar lines, in points." ), _Section("Histogram plots"), _Param( @@ -3290,7 +3381,8 @@ class _Subsection: "auto", "sturges", "fd", "doane", "scott", "rice", "sqrt" ], validator=validate_hist_bins, - description="The default number of histogram bins or 'auto'." + description="The default histogram bin count, explicit list of bin edges, or " + "automatic binning mode." ), _Section("Scatter plots"), _Param( @@ -3305,7 +3397,7 @@ class _Subsection: default="face", type=str, validator=validate_string, - description="The default edge colors for scatter plots." + description="The default edge color behavior for scatter plots." ), _Section("AGG rendering"), _Param( @@ -3370,42 +3462,43 @@ class _Subsection: default="figure", type=Literal["figure"] | float, validator=validate_dpi, - description="figure dots per inch or 'figure'" + description="The output figure DPI, or 'figure' to use the figure DPI." ), _Param( "savefig.facecolor", default="auto", type=':mpltype:`color` or "auto"', validator=validate_color_or_auto, - description="figure face color when saving" + description="The figure face color when saving." ), _Param( "savefig.edgecolor", default="auto", type=':mpltype:`color` or "auto"', validator=validate_color_or_auto, - description="figure edge color when saving" + description="The figure edge color when saving." ), _Param( "savefig.format", default="png", type=str, - validator=validate_string, description="{png, ps, pdf, svg}" + validator=validate_string, + description="The default file format for `savefig`, such as {png, ps, pdf, svg}." ), _Param( "savefig.bbox", default=None, type=Literal["tight", "standard"] | None, validator=validate_bbox, - description="{tight, standard} 'tight' is incompatible with generating frames " - "for animation" + description="Whether to use a tight bounding box or the standard figure box;" + "tight is incompatible with animation frames." ), _Param( "savefig.pad_inches", default=0.1, type=float, validator=validate_float, - description="padding to be used, when bbox is set to 'tight'" + description="The padding to use when `savefig.bbox` is set to 'tight'." ), _Param( "savefig.directory", @@ -3422,7 +3515,7 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="whether figures are saved with a transparent background by default" + description="Whether figures are saved with a transparent background." ), _Param( @@ -3430,7 +3523,7 @@ class _Subsection: default="portrait", type=Literal["landscape", "portrait"], validator=["landscape", "portrait"], - description="orientation of saved figure, for PostScript output only" + description="The page orientation for saved figures, for PostScript output only." ), _Subsection("Mac OSX backend parameters"), _Param( @@ -3438,8 +3531,8 @@ class _Subsection: default="system", type=Literal["system", "tab", "window"], validator=["system", "tab", "window"], - description="How to open new figures (system, tab, window) system uses " - "the MacOS system preferences" + description="How to open new figures: 'system', 'tab', or 'window'; " + "'system' uses the macOS system preferences." ), _Subsection("Tk backend parameters"), _Param( @@ -3447,7 +3540,7 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="Maintain shell focus for TkAgg" + description="Whether TkAgg should keep shell focus after opening a figure." ), _Subsection("PS backend parameters"), _Param( @@ -3463,14 +3556,14 @@ class _Subsection: *[f"{ab}{i}" for ab in "ab" for i in range(11)], ], ), - description="{figure, letter, legal, ledger, A0-A10, B0-B10}" + description="The default PostScript paper size: {figure, letter, legal, ledger, A0-A10, B0-B10}." ), _Param( "ps.useafm", default=False, type=bool, validator=validate_bool, - description="use AFM fonts, results in small files" + description="Whether to use AFM fonts, which typically produces smaller files." ), _Param( "ps.usedistiller", @@ -3485,7 +3578,8 @@ class _Subsection: "ps.distiller.res", default=6000, type=int, - validator=validate_int, description="dpi" + validator=validate_int, + description="The resolution, in DPI, used by the PostScript distiller." ), _Param( "ps.fonttype", @@ -3501,7 +3595,7 @@ class _Subsection: default=6, type=int, validator=validate_int, - description="integer from 0 to 9 0 disables compression (good for debugging)" + description="An integer from 0 to 9; 0 disables compression." ), _Param( "pdf.fonttype", @@ -3516,6 +3610,7 @@ class _Subsection: default=False, type=bool, validator=validate_bool, + description="Whether to use the 14 standard PDF fonts instead of embedding fonts." ), _Param( "pdf.inheritcolor", @@ -3529,25 +3624,25 @@ class _Subsection: default=True, type=bool, validator=validate_bool, - description="Write raster image data directly into the SVG file" + description="Whether to write raster image data directly into the SVG file." ), _Param( "svg.fonttype", default="path", type=Literal["none", "path"], validator=["none", "path"], - description="How to handle SVG fonts: " - "path: Embed characters as paths -- supported by most SVG " - " renderers" - "none: Assume fonts are installed on the machine where the SVG " - "will be viewed." + description=( + "How to handle SVG fonts: 'path' embeds characters as paths and is " + "supported by most SVG renderers; 'none' assumes the fonts are installed " + "on the machine where the SVG is viewed." + ) ), _Param( "svg.hashsalt", default=None, type=str | None, validator=validate_string_or_None, - description="If not None, use this string as hash salt instead of uuid4" + description="If not None, use this string as the hash salt instead of uuid4." ), _Param( "svg.id", @@ -3555,7 +3650,7 @@ class _Subsection: type=str | None, validator=validate_string_or_None, description="If not None, use this string as the value for the `id` attribute " - "in the top tag" + "in the top tag." ), _Subsection("PGF parameters"), _Param( @@ -3563,19 +3658,21 @@ class _Subsection: default=True, type=bool, validator=validate_bool, + description="Whether to copy font settings from rcParams into PGF output." ), _Param( "pgf.preamble", default="", type=str, validator=validate_string, - description="See text.latex.preamble for documentation" + description="See `text.latex.preamble` for documentation." ), _Param( "pgf.texsystem", default="xelatex", type=Literal["xelatex", "lualatex", "pdflatex"], - validator=["xelatex", "lualatex", "pdflatex"] + validator=["xelatex", "lualatex", "pdflatex"], + description="The TeX engine to use for PGF output." ), _Subsection("Docstring parameters"), _Param( @@ -3583,7 +3680,7 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="set this when you want to generate hardcopy docstring" + description="Set this when you want to generate hardcopy docstrings." ), _Section( "Interactive keymaps", @@ -3595,101 +3692,105 @@ class _Subsection: default=["f", "ctrl+f"], type=list[str], validator=validate_stringlist, - description="toggling" + description="Keyboard shortcuts for toggling fullscreen mode." ), _Param( "keymap.home", default=["h", "r", "home"], type=list[str], validator=validate_stringlist, - description="home or reset mnemonic" + description="Keyboard shortcuts for resetting the view." ), _Param( "keymap.back", default=["left", "c", "backspace", "MouseButton.BACK"], type=list[str], - validator=validate_stringlist, description="forward / backward keys" + validator=validate_stringlist, + description="Keyboard shortcuts for moving backward in the view history." ), _Param( "keymap.forward", default=["right", "v", "MouseButton.FORWARD"], type=list[str], validator=validate_stringlist, - description="for quick navigation" + description="Keyboard shortcuts for moving forward in the view history." ), _Param( "keymap.pan", default=["p"], type=list[str], - validator=validate_stringlist, description="pan mnemonic" + validator=validate_stringlist, + description="Keyboard shortcuts for panning the view." ), _Param( "keymap.zoom", default=["o"], type=list[str], - validator=validate_stringlist, description="zoom mnemonic" + validator=validate_stringlist, + description="Keyboard shortcuts for zooming the view." ), _Param( "keymap.save", default=["s", "ctrl+s"], type=list[str], validator=validate_stringlist, - description="saving current figure" + description="Keyboard shortcuts for saving the current figure." ), _Param( "keymap.help", default=["f1"], type=list[str], validator=validate_stringlist, - description="display help about active tools" + description="Keyboard shortcuts for showing help about active tools." ), _Param( "keymap.quit", default=["ctrl+w", "cmd+w", "q"], type=list[str], validator=validate_stringlist, - description="close the current figure" + description="Keyboard shortcuts for closing the current figure." ), _Param( "keymap.quit_all", default=[], type=list[str], - validator=validate_stringlist, description="close all figures" + validator=validate_stringlist, + description="Keyboard shortcuts for closing all figures." ), _Param( "keymap.grid", default=["g"], type=list[str], validator=validate_stringlist, - description="switching on/off major grids in current axes" + description="Keyboard shortcuts for toggling the major grid in the current axes." ), _Param( "keymap.grid_minor", default=["G"], type=list[str], validator=validate_stringlist, - description="switching on/off minor grids in current axes" + description="Keyboard shortcuts for toggling the minor grid in the current axes." ), _Param( "keymap.yscale", default=["l"], type=list[str], validator=validate_stringlist, - description="toggle scaling of y-axes ('log'/'linear')" + description="Keyboard shortcuts for toggling the y-axis scale between log and linear." ), _Param( "keymap.xscale", default=["k", "L"], type=list[str], validator=validate_stringlist, - description="toggle scaling of x-axes ('log'/'linear')" + description="Keyboard shortcuts for toggling the x-axis scale between log and linear." ), _Param( "keymap.copy", default=["ctrl+c", "cmd+c"], type=list[str], validator=validate_stringlist, - description="copy figure to clipboard" + description="Keyboard shortcuts for copying the figure to the clipboard." ), _Section("Animation"), _Param( @@ -3697,31 +3798,32 @@ class _Subsection: default="none", type=Literal["html5", "jshtml", "none"], validator=["html5", "jshtml", "none"], - description="How to display the animation as HTML in the IPython notebook: " - "- 'html5' uses HTML5 video tag " - "- 'jshtml' creates a JavaScript animation" + description="How to display animations as HTML in IPython notebooks: " + "'html5' uses the HTML5 video tag, " + "'jshtml' creates a JavaScript animation, and " + "'none' disables HTML output." ), _Param( "animation.writer", default="ffmpeg", type=str, validator=validate_string, - description="MovieWriter 'backend' to use" + description="The MovieWriter backend to use." ), _Param( "animation.codec", default="h264", type=str, validator=validate_string, - description="Codec to use for writing movie" + description="The codec to use when writing movies." ), _Param( "animation.bitrate", default=-1, type=int, validator=validate_int, - description="Controls size/quality trade-off for movie. -1 implies let " - "utility auto-determine" + description="The bitrate used for movies; -1 lets the utility choose " + "automatically." ), _Param("animation.frame_format", "png", type=Literal[ @@ -3730,7 +3832,7 @@ class _Subsection: validator=[ "png", "jpeg", "tiff", "raw", "rgba", "ppm", "sgi", "bmp", "pbm", "svg", ], - description="Controls frame format used by temp files" + description="The frame format used for temporary files." ), _Param( "animation.ffmpeg_path", @@ -3745,7 +3847,7 @@ class _Subsection: default=[], type=list[str], validator=validate_stringlist, - description="Additional arguments to pass to ffmpeg" + description="Additional arguments to pass to ffmpeg." ), _Param( "animation.convert_path", @@ -3762,21 +3864,22 @@ class _Subsection: default=["-layers", "OptimizePlus"], type=list[str], validator=validate_stringlist, - description="Additional arguments to pass to convert" + description="Additional arguments to pass to ``convert``." ), _Param( "animation.embed_limit", default=20.0, type=float, validator=validate_float, - description="Limit, in MB, of size of base64 encoded animation in HTML (i.e. " - "IPython notebook)" + description="The maximum base64-encoded animation size, in MB, for HTML " + "output such as IPython notebooks." ), _Param( "_internal.classic_mode", default=False, type=bool, validator=validate_bool, + description="Whether classic Matplotlib defaults are enabled." ), _Param("backend", None, None, validate_backend), ] From 9127d47b8eb5617db9ea9a959600eac352bb37dc Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 2 Oct 2026 21:32:24 +0200 Subject: [PATCH 084/210] DOC: Improve violin/violin_stats/violinplot docs Closes #32409. Co-authored-by: hannah --- lib/matplotlib/axes/_axes.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 276d7b61b852..d5055f820e0b 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -9105,8 +9105,26 @@ def violinplot(self, dataset, positions=None, vert=None, See Also -------- + .cbook.violin_stats : calculate statistical properties of a dataset for violin + plotting. .Axes.violin : Draw a violin from pre-computed statistics. boxplot : Draw a box and whisker plot. + + Notes + ----- + The following calls are identical :: + + ax.violinplot() + + and :: + + from matplotlib.cbook import violin_stats + + stats = violin_stats() + ax.violin(stats) + + `.violin_stats` gives you more control of the statistical calculations than + `.violinplot`. """ vpstats = cbook.violin_stats(dataset, ("GaussianKDE", bw_method), points=points, quantiles=quantiles) @@ -9246,6 +9264,22 @@ def violin(self, vpstats, positions=None, vert=None, Draw a violin plot from data instead of pre-computed statistics. .cbook.violin_stats: Calculate a *vpstats* dictionary from data, suitable for passing to violin. + + Notes + ----- + The following calls are identical :: + + ax.violinplot() + + and :: + + from matplotlib.cbook import violin_stats + + stats = violin_stats() + ax.violin(stats) + + `.violin_stats` gives you more control of the statistical calculations than + `.violinplot`. """ # Statistical quantities to be plotted on the violins From 7bef015ebdf0a0e34a93b308490a9f77a90af4a2 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Fri, 2 Oct 2026 12:33:59 +0200 Subject: [PATCH 085/210] Fix AsinhLocator invalid value warning in np.floor on riscv64 np.log10(0) produces -inf, and np.floor(-inf) is fine. But on riscv64 the intermediate NaN from the full expression evaluation triggers "RuntimeWarning: invalid value encountered in floor". The existing errstate only suppresses "divide" warnings but not "invalid". This causes TestAsinhLocator tests and test_minorticks_toggle to fail on riscv64. --- lib/matplotlib/ticker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 391e24dd2a06..820e5cc18e24 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -2890,7 +2890,8 @@ def tick_values(self, vmin, vmax): # Round the data-space values to be intuitive base-n numbers, keeping track of # positive and negative values separately and carefully treating the zero value. - with np.errstate(divide="ignore"): # base ** log(0) = base ** -inf = 0. + # base ** log(0) = base ** -inf = 0. + with np.errstate(divide="ignore", invalid="ignore"): if self.base > 1: pows = (np.sign(xs) * self.base ** np.floor(np.log(abs(xs)) / math.log(self.base))) From 55ae88b8c2cd5607b12af94b8a853d6bd7e3baec Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 7 Oct 2026 11:47:13 +0200 Subject: [PATCH 086/210] Apply suggestions from code review. --- lib/matplotlib/rcsetup.py | 122 +++++++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 49 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index e1dce9676a7e..e57339c4c34a 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1629,8 +1629,9 @@ class _Subsection: ), _Section( "Lines", - description="Default properties for line objects, such as those returned by " - "plot()." + description="Default properties for line objects. Some plotting functions such " + "as `~.Axes.plot` may override them with information from the " + "property cycle; see :ref:`color_cycle`." ), _Param( "lines.linewidth", @@ -1763,7 +1764,8 @@ class _Subsection: default="auto", type=Literal["auto", "flat", "nearest", "gouraud"], validator=["auto", "flat", "nearest", "gouraud"], - description="The default shading mode for `.pcolor` and `.pcolormesh`." + description="The default shading mode for `~.Axes.pcolor` and " + "`~.Axes.pcolormesh`." ), _Param( "pcolormesh.snap", @@ -1817,7 +1819,7 @@ class _Subsection: ), _Section("Hatches"), _Param("hatch.color", "edge", ':mpltype:`color` or "edge"', - _validate_color_or_edge, description="The color used for hatch strokes."), + _validate_color_or_edge, description="The color of hatch strokes."), _Param("hatch.linewidth", 1.0, float, validate_float, description="The width of hatch strokes, in points."), _Section("Boxplot"), @@ -1826,11 +1828,14 @@ class _Subsection: _Param("boxplot.vertical", True, bool, validate_bool, description="Whether to draw vertical boxplots."), _Param("boxplot.whiskers", 1.5, float | tuple[float, float], validate_whiskers, - description="The whisker length as a multiple of the interquartile range, or a (lower, upper) pair."), + description="The whisker length as a multiple of the interquartile range, " + "or a (lower, upper) pair."), _Param("boxplot.bootstrap", None, int | None, validate_int_or_None, - description="The number of bootstrap resamples used to estimate boxplot notches; None disables bootstrapping."), + description="The number of bootstrap resamples used to estimate boxplot " + "notches; None disables bootstrapping."), _Param("boxplot.patchartist", False, bool, validate_bool, - description="Whether boxplots should be drawn as patches instead of line artists."), + description="Whether boxplots should be drawn as patches instead of line " + "artists."), _Param("boxplot.showmeans", False, bool, validate_bool, description="Whether to draw the mean on boxplots."), _Param("boxplot.showcaps", True, bool, validate_bool, @@ -1844,7 +1849,7 @@ class _Subsection: _Param("boxplot.flierprops.color", "black", ":mpltype:`color`", validate_color, description="The color of the flier markers."), _Param("boxplot.flierprops.marker", "o", _MarkerType, _validate_marker, - description="The marker style used for flier points."), + description="The marker style used for flier markers."), _Param("boxplot.flierprops.markerfacecolor", "none", ':mpltype:`color` or "auto"', validate_color_or_auto, description="The face color of flier markers."), @@ -1906,8 +1911,7 @@ class _Subsection: _Param("font.family", ["sans-serif"], list[str], validate_stringlist, description="A prioritized list of font families to try."), _Param("font.style", "normal", Literal["normal", "italic", "oblique"], - validate_string, - description="The default font style."), + validate_string, description="The default font style."), _Param("font.variant", "normal", Literal["normal", "small-caps"], validate_string, description="The default font variant."), _Param("font.weight", "normal", _FontWeightType, validator=validate_fontweight, @@ -1926,7 +1930,8 @@ class _Subsection: ], type=list[str], validator=validate_stringlist, - description="Preferred serif font families." + description='Fonts to be used for the generic "serif" font family ' + 'specifier, in descending priority.' ), _Param( "font.sans-serif", @@ -1937,7 +1942,8 @@ class _Subsection: ], type=list[str], validator=validate_stringlist, - description="Preferred sans-serif font families." + description='Fonts to be used for the generic "sans-serif" font family ' + 'specifier, in descending priority.' ), _Param( "font.cursive", @@ -1947,14 +1953,16 @@ class _Subsection: ], type=list[str], validator=validate_stringlist, - description="Preferred cursive font families." + description='Fonts to be used for the generic "cursive" font family ' + 'specifier, in descending priority.' ), _Param( "font.fantasy", default=["Chicago", "Charcoal", "Impact", "Western", "xkcd script", "fantasy"], type=list[str], validator=validate_stringlist, - description="Preferred fantasy font families." + description='Fonts to be used for the generic "fantasy" font family ' + 'specifier, in descending priority.' ), _Param( "font.monospace", @@ -1965,7 +1973,8 @@ class _Subsection: ], type=list[str], validator=validate_stringlist, - description="Preferred monospace font families." + description='Fonts to be used for the generic "monospace" font family ' + 'specifier, in descending priority.' ), _Param( "font.enable_last_resort", @@ -2218,8 +2227,9 @@ class _Subsection: default=None, type=float | None, validator=validate_float_or_None, - description="The title position in Axes-relative units; None enables" - "automatic placement." + description="The vertical title position in " + ":ref:`axes coordinates `; " + "None enables automatic placement." ), _Param( "axes.titlepad", @@ -2353,7 +2363,8 @@ class _Subsection: (0.09019607843137255, 0.7450980392156863, 0.8117647058823529)], ), validator=validate_cycler, - description="The cycler used to cycle through line colors and other artist properties." + description="The property cycle used by plotting functions to vary artist " + "properties on subsequent calls." ), _Param( "axes.xmargin", @@ -3019,9 +3030,10 @@ class _Subsection: default="None", type=':mpltype:`color` or {"linecolor", "markerfacecolor", "markeredgecolor"}', validator=_validate_color_or_linecolor, - description='The color of legend text; use "linecolor", "markerfacecolor", ' - 'or "markeredgecolor" line- or marker-based colors to ' - 'follow the respective color of the legend handle.' + description="The color of the labels in legend entries. The special values " + "'linecolor', 'markerfacecolor', and 'markeredgecolor' " + "infer the color from the associated legend handle; i.e. using " + "'linecolor' will render the label of a red line also in red." ), _Param( "legend.title_fontsize", @@ -3266,7 +3278,7 @@ class _Subsection: default="auto", type=str, validator=validate_string, - description="The default interpolation method for images; see `.Axes. imshow` " + description="The default interpolation method for images; see `~.Axes.imshow` " "for details.", ), _Param( @@ -3275,7 +3287,7 @@ class _Subsection: type=Literal["auto", "data", "rgba"], validator=["auto", "data", "rgba"], description="The stage at which image interpolation is applied; " - "see `.Axes. imshow` for details.", + "see `~.Axes.imshow` for details.", ), _Param( "image.cmap", @@ -3381,8 +3393,10 @@ class _Subsection: "auto", "sturges", "fd", "doane", "scott", "rice", "sqrt" ], validator=validate_hist_bins, - description="The default histogram bin count, explicit list of bin edges, or " - "automatic binning mode." + description="The default histogram bins. An integer specifies a fixed number " + "of bins; a list of floats specifies the bin edges; the strings " + "define binning strategies. See also the *bins* parameter in " + "`~.Axes.hist`." ), _Section("Scatter plots"), _Param( @@ -3483,7 +3497,10 @@ class _Subsection: default="png", type=str, validator=validate_string, - description="The default file format for `savefig`, such as {png, ps, pdf, svg}." + description="Fallback file format for`~.Figure.savefig` if no format is " + "set explicitly and it also couldn't be inferred from the file " + "extension. Valid values are the values that the " + "*format* parameter of ``savefig`` accepts." ), _Param( "savefig.bbox", @@ -3498,7 +3515,7 @@ class _Subsection: default=0.1, type=float, validator=validate_float, - description="The padding to use when `savefig.bbox` is set to 'tight'." + description="The padding to use when 'savefig.bbox' is set to 'tight'." ), _Param( "savefig.directory", @@ -3523,7 +3540,8 @@ class _Subsection: default="portrait", type=Literal["landscape", "portrait"], validator=["landscape", "portrait"], - description="The page orientation for saved figures, for PostScript output only." + description="The page orientation for saved figures, for PostScript output " + "only." ), _Subsection("Mac OSX backend parameters"), _Param( @@ -3556,7 +3574,7 @@ class _Subsection: *[f"{ab}{i}" for ab in "ab" for i in range(11)], ], ), - description="The default PostScript paper size: {figure, letter, legal, ledger, A0-A10, B0-B10}." + description="The default PostScript paper size." ), _Param( "ps.useafm", @@ -3595,7 +3613,8 @@ class _Subsection: default=6, type=int, validator=validate_int, - description="An integer from 0 to 9; 0 disables compression." + description="The PDF compression level between 0 (compression disabled) and " + "9 (maximal compression)." ), _Param( "pdf.fonttype", @@ -3610,7 +3629,8 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="Whether to use the 14 standard PDF fonts instead of embedding fonts." + description="Whether to only use the Base 14 fonts defined by the PDF " + "specification. If False, fonts are embedded into the PDF." ), _Param( "pdf.inheritcolor", @@ -3665,7 +3685,7 @@ class _Subsection: default="", type=str, validator=validate_string, - description="See `text.latex.preamble` for documentation." + description="See 'text.latex.preamble' for documentation." ), _Param( "pgf.texsystem", @@ -3680,7 +3700,7 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="Set this when you want to generate hardcopy docstrings." + description="Whether to generate hardcopy docstrings." ), _Section( "Interactive keymaps", @@ -3692,105 +3712,109 @@ class _Subsection: default=["f", "ctrl+f"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for toggling fullscreen mode." + description="The keyboard shortcuts for toggling fullscreen mode." ), _Param( "keymap.home", default=["h", "r", "home"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for resetting the view." + description="The keyboard shortcuts for resetting the view." ), _Param( "keymap.back", default=["left", "c", "backspace", "MouseButton.BACK"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for moving backward in the view history." + description="The keyboard shortcuts for moving backward in the view history." ), _Param( "keymap.forward", default=["right", "v", "MouseButton.FORWARD"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for moving forward in the view history." + description="The keyboard shortcuts for moving forward in the view history." ), _Param( "keymap.pan", default=["p"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for panning the view." + description="The keyboard shortcuts for panning the view." ), _Param( "keymap.zoom", default=["o"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for zooming the view." + description="The keyboard shortcuts for zooming the view." ), _Param( "keymap.save", default=["s", "ctrl+s"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for saving the current figure." + description="The keyboard shortcuts for saving the current figure." ), _Param( "keymap.help", default=["f1"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for showing help about active tools." + description="The keyboard shortcuts for showing help about active tools." ), _Param( "keymap.quit", default=["ctrl+w", "cmd+w", "q"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for closing the current figure." + description="The keyboard shortcuts for closing the current figure." ), _Param( "keymap.quit_all", default=[], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for closing all figures." + description="The keyboard shortcuts for closing all figures." ), _Param( "keymap.grid", default=["g"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for toggling the major grid in the current axes." + description="The keyboard shortcuts for toggling the major grid in the " + "current axes." ), _Param( "keymap.grid_minor", default=["G"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for toggling the minor grid in the current axes." + description="The keyboard shortcuts for toggling the minor grid in the " + "current axes." ), _Param( "keymap.yscale", default=["l"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for toggling the y-axis scale between log and linear." + description="The keyboard shortcuts for toggling the y-axis scale between " + "log and linear." ), _Param( "keymap.xscale", default=["k", "L"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for toggling the x-axis scale between log and linear." + description="The keyboard shortcuts for toggling the x-axis scale between " + "log and linear." ), _Param( "keymap.copy", default=["ctrl+c", "cmd+c"], type=list[str], validator=validate_stringlist, - description="Keyboard shortcuts for copying the figure to the clipboard." + description="The keyboard shortcuts for copying the figure to the clipboard." ), _Section("Animation"), _Param( @@ -3871,7 +3895,7 @@ class _Subsection: default=20.0, type=float, validator=validate_float, - description="The maximum base64-encoded animation size, in MB, for HTML " + description="The maximum Base64-encoded animation size, in MB, for HTML " "output such as IPython notebooks." ), _Param( From 9e59ae7c541411c52f7140272c48009f1d385a26 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:22:15 +0200 Subject: [PATCH 087/210] DOC: Simplify language of rcParams descriptions --- lib/matplotlib/rcsetup.py | 73 ++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index e57339c4c34a..3f5b01e0bae4 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1567,14 +1567,14 @@ class _Subsection: default=8988, type=int, validator=validate_int, - description="The port to use for the web server in the WebAgg backend." + description="The server port in the WebAgg backend." ), _Param( "webagg.address", default="127.0.0.1", type=str, validator=validate_string, - description="The address on which the WebAgg web server should be reachable." + description="The server address in the WebAgg backend." ), _Param( "webagg.port_retries", @@ -1589,7 +1589,7 @@ class _Subsection: default=True, type=bool, validator=validate_bool, - description="When True, open the web browser to the plot that is shown" + description="When True, open the web browser to the plot that is shown." ), _Param( "backend_fallback", @@ -1629,7 +1629,7 @@ class _Subsection: ), _Section( "Lines", - description="Default properties for line objects. Some plotting functions such " + description="Default line properties. Some plotting functions such " "as `~.Axes.plot` may override them with information from the " "property cycle; see :ref:`color_cycle`." ), @@ -1849,7 +1849,7 @@ class _Subsection: _Param("boxplot.flierprops.color", "black", ":mpltype:`color`", validate_color, description="The color of the flier markers."), _Param("boxplot.flierprops.marker", "o", _MarkerType, _validate_marker, - description="The marker style used for flier markers."), + description="The marker style of flier markers."), _Param("boxplot.flierprops.markerfacecolor", "none", ':mpltype:`color` or "auto"', validate_color_or_auto, description="The face color of flier markers."), @@ -1860,9 +1860,9 @@ class _Subsection: _Param("boxplot.flierprops.markersize", 6.0, float, validate_float, description="The flier marker size, in points."), _Param("boxplot.flierprops.linestyle", "none", _LineStyleType, _validate_linestyle, - description="The line style used for flier markers."), + description="The line style of flier markers."), _Param("boxplot.flierprops.linewidth", 1.0, float, validate_float, - description="The line width used for flier markers, in points."), + description="The line width of flier markers, in points."), _Param("boxplot.boxprops.color", "black", ':mpltype:`color`', validate_color, description="The box outline color."), _Param("boxplot.boxprops.linewidth", 1.0, float, validate_float, @@ -1890,7 +1890,7 @@ class _Subsection: _Param("boxplot.meanprops.color", "C2", ':mpltype:`color`', validate_color, description="The mean marker or line color."), _Param("boxplot.meanprops.marker", "^", _MarkerType, _validate_marker, - description="The marker style used for the mean."), + description="The marker style of the mean marker."), _Param("boxplot.meanprops.markerfacecolor", "C2", ':mpltype:`color`', validate_color, description="The face color of the mean marker."), _Param("boxplot.meanprops.markeredgecolor", "C2", ':mpltype:`color`', @@ -1898,9 +1898,9 @@ class _Subsection: _Param("boxplot.meanprops.markersize", 6.0, float, validate_float, description="The mean marker size, in points."), _Param("boxplot.meanprops.linestyle", "--", _LineStyleType, _validate_linestyle, - description="The line style used for the mean marker or line."), + description="The line style of the mean marker or line."), _Param("boxplot.meanprops.linewidth", 1.0, float, validate_float, - description="The line width used for the mean marker or line, in points."), + description="The line width of the mean marker or line, in points."), _Section( "Font", description="The font properties used by `.Text` " @@ -2114,19 +2114,19 @@ class _Subsection: "'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'" ), _Param("mathtext.bf", "sans:bold", str, validate_font_properties, - description="The font config pattern used for bold math text."), + description="The font config pattern for bold math text."), _Param("mathtext.bfit", "sans:italic:bold", str, validate_font_properties, - description="The font config pattern used for bold italic math text."), + description="The font config pattern for bold italic math text."), _Param("mathtext.cal", "cursive", str, validate_font_properties, - description="The font config pattern used for calligraphic math text."), + description="The font config pattern for calligraphic math text."), _Param("mathtext.it", "sans:italic", str, validate_font_properties, - description="The font config pattern used for italic math text."), + description="The font config pattern for italic math text."), _Param("mathtext.rm", "sans", str, validate_font_properties, - description="The font config pattern used for roman math text."), + description="The font config pattern for roman math text."), _Param("mathtext.sf", "sans", str, validate_font_properties, - description="The font config pattern used for sans-serif math text."), + description="The font config pattern for sans-serif math text."), _Param("mathtext.tt", "monospace", str, validate_font_properties, - description="The font config pattern used for monospace math text."), + description="The font config pattern for monospace math text."), _Param( "mathtext.fallback", default="cm", @@ -2147,9 +2147,9 @@ class _Subsection: validator=["rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", "scr", "regular", "normal"], description=( - 'The default font to use for math. Can be any of the LaTeX font names, ' - 'including the special name "regular" for the same font used in regular ' - 'text.'), + 'The default font for math-formatted text. Can be any of the LaTeX font ' + 'names, including the special name "regular" for the same font used in ' + 'regular text.'), ), _Section("Axes"), _Param( @@ -2508,31 +2508,31 @@ class _Subsection: ), _Param( "date.autoformatter.year", "%Y", str, validate_string, - description="The strftime format used for year ticks." + description="The strftime format for year ticks." ), _Param( "date.autoformatter.month", "%Y-%m", str, validate_string, - description="The strftime format used for month ticks." + description="The strftime format for month ticks." ), _Param( "date.autoformatter.day", "%Y-%m-%d", str, validate_string, - description="The strftime format used for day ticks." + description="The strftime format for day ticks." ), _Param( "date.autoformatter.hour", "%m-%d %H", str, validate_string, - description="The strftime format used for hour ticks." + description="The strftime format for hour ticks." ), _Param( "date.autoformatter.minute", "%d %H:%M", str, validate_string, - description="The strftime format used for minute ticks." + description="The strftime format for minute ticks." ), _Param( "date.autoformatter.second", "%H:%M:%S", str, validate_string, - description="The strftime format used for second ticks." + description="The strftime format for second ticks." ), _Param( "date.autoformatter.microsecond", "%M:%S.%f", str, validate_string, - description="The strftime format used for microsecond ticks." + description="The strftime format for microsecond ticks." ), _Param( "date.epoch", @@ -3669,8 +3669,8 @@ class _Subsection: default=None, type=str | None, validator=validate_string_or_None, - description="If not None, use this string as the value for the `id` attribute " - "in the top tag." + description="If not None, use this string as the value for the ``id`` " + "attribute in the top ```` tag." ), _Subsection("PGF parameters"), _Param( @@ -3832,22 +3832,21 @@ class _Subsection: default="ffmpeg", type=str, validator=validate_string, - description="The MovieWriter backend to use." + description="The MovieWriter backend." ), _Param( "animation.codec", default="h264", type=str, validator=validate_string, - description="The codec to use when writing movies." + description="The codec for writing movies." ), _Param( "animation.bitrate", default=-1, type=int, validator=validate_int, - description="The bitrate used for movies; -1 lets the utility choose " - "automatically." + description="The animation bitrate; -1 lets the utility choose automatically." ), _Param("animation.frame_format", "png", type=Literal[ @@ -3856,7 +3855,8 @@ class _Subsection: validator=[ "png", "jpeg", "tiff", "raw", "rgba", "ppm", "sgi", "bmp", "pbm", "svg", ], - description="The frame format used for temporary files." + description="The file format of temporary files for rendering animation " + "frames." ), _Param( "animation.ffmpeg_path", @@ -3878,7 +3878,7 @@ class _Subsection: default="convert", type=str, validator=_validate_pathlike, - description="Path to ImageMagick's convert binary. Unqualified paths are " + description="Path to ImageMagick's ``convert`` binary. Unqualified paths are " "resolved by subprocess.Popen, except that on Windows, we look up " "an install of ImageMagick in the registry (as convert is also the " "name of a system tool)." @@ -3903,7 +3903,8 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="Whether classic Matplotlib defaults are enabled." + description="Whether classic Matplotlib defaults are enabled. This is mainly " + "for backward compatibility in testing contexts." ), _Param("backend", None, None, validate_backend), ] From 92b88091aa1494a556265b910a5b35efbf32668d Mon Sep 17 00:00:00 2001 From: Nillohit Roy Date: Sun, 4 Oct 2026 12:50:24 +0530 Subject: [PATCH 088/210] ENH: added sharex/sharey string support to subplot_mosaic --- lib/matplotlib/figure.py | 75 +++++++++++++++++++++++++---- lib/matplotlib/pyplot.py | 18 +++---- lib/matplotlib/tests/test_figure.py | 59 ++++++++++++++++++++++- 3 files changed, 131 insertions(+), 21 deletions(-) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 9920f6d908b3..bafb5b623495 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2117,8 +2117,16 @@ def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False, per_subplot_kw = self._norm_per_subplot_kw(per_subplot_kw) - # Only accept strict bools to allow a possible future API expansion. - _api.check_isinstance(bool, sharex=sharex, sharey=sharey) + # Custom Validation Function to check for booleans and strings. + def _validate_share_param(param_name, value): + if type(value) is bool: + return value + if value in ["all", "row", "col"]: + return value + raise ValueError(f"{param_name} must be True, False, 'all', 'row', or 'col'") + + sharex = _validate_share_param("sharex", sharex) + sharey = _validate_share_param("sharey", sharey) def _make_array(inp): """ @@ -2277,14 +2285,61 @@ def _do_layout(gs, mosaic, unique_ids, nested): rows, cols = mosaic.shape gs = self.add_gridspec(rows, cols, **gridspec_kw) ret = _do_layout(gs, mosaic, *_identify_keys_and_nested(mosaic)) - ax0 = next(iter(ret.values())) - for ax in ret.values(): - if sharex: - ax.sharex(ax0) - ax._label_outer_xaxis(skip_non_rectangular_axes=True) - if sharey: - ax.sharey(ax0) - ax._label_outer_yaxis(skip_non_rectangular_axes=True) + # Asymmetrical/Directional Implementation that needs to be changed + # ax0 = next(iter(ret.values())) + # for ax in ret.values(): + # if sharex: + # ax.sharex(ax0) + # ax._label_outer_xaxis(skip_non_rectangular_axes=True) + # if sharey: + # ax.sharey(ax0) + # ax._label_outer_yaxis(skip_non_rectangular_axes=True) + + # Symmetric Sharing + def _apply_sharing(ret_dict, share_val, axis_name): + if share_val is False: + return + + # Group the axes based on their spans + groups = {} + for ax in ret_dict.values(): + span = ax.get_subplotspec() + grid = span.get_gridspec() + + if share_val is True or share_val == "all": + groups.setdefault("all", []).append(ax) + elif share_val == "row": + groups.setdefault((grid, span.rowspan.start, span.rowspan.stop), []).append(ax) + elif share_val == "col": + groups.setdefault((grid, span.colspan.start, span.colspan.stop), []).append(ax) + + # Bind the groups together + for group in groups.values(): + if len(group) > 1: + parent = group[0] + for child_ax in group[1:]: + if axis_name == 'x': + child_ax.sharex(parent) + else: + child_ax.sharey(parent) + + # Handle tick label visibility per isolated group + if axis_name == 'x': + # Find the bottom-most edge within a specific group + bottom_edge = max(ax.get_subplotspec().rowspan.stop for ax in group) + for ax in group: + if ax.get_subplotspec().rowspan.stop < bottom_edge: + ax.tick_params(labelbottom=False) + else: + # Find the left-most edge within a specific group + left_edge = min(ax.get_subplotspec().colspan.start for ax in group) + for ax in group: + if ax.get_subplotspec().colspan.start > left_edge: + ax.tick_params(labelleft=False) + + _apply_sharing(ret, sharex, 'x') + _apply_sharing(ret, sharey, 'y') + if extra := set(per_subplot_kw) - set(ret): raise ValueError( f"The keys {extra} are in *per_subplot_kw* " diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 6671e07af64c..81a2e759041f 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -54,7 +54,7 @@ import sys import threading import time -from typing import IO, TYPE_CHECKING, cast, overload +from typing import IO, TYPE_CHECKING, cast, overload, Literal from cycler import cycler # noqa: F401 import matplotlib @@ -1896,8 +1896,8 @@ def subplots( def subplot_mosaic( mosaic: str, *, - sharex: bool = ..., - sharey: bool = ..., + sharex: bool | Literal["all", "row", "col"] = ..., + sharey: bool | Literal["all", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: str = ..., @@ -1912,8 +1912,8 @@ def subplot_mosaic( def subplot_mosaic[T]( mosaic: list[HashableList[T]], *, - sharex: bool = ..., - sharey: bool = ..., + sharex: bool | Literal["all", "row", "col"] = ..., + sharey: bool | Literal["all", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: T = ..., @@ -1928,8 +1928,8 @@ def subplot_mosaic[T]( def subplot_mosaic( mosaic: list[HashableList[Hashable]], *, - sharex: bool = ..., - sharey: bool = ..., + sharex: bool | Literal["all", "row", "col"] = ..., + sharey: bool | Literal["all", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: Any = ..., @@ -1943,8 +1943,8 @@ def subplot_mosaic( def subplot_mosaic[T]( mosaic: str | list[HashableList[T]] | list[HashableList[Hashable]], *, - sharex: bool = False, - sharey: bool = False, + sharex: bool | Literal["all", "row", "col"] = False, + sharey: bool | Literal["all", "row", "col"] = False, width_ratios: ArrayLike | None = None, height_ratios: ArrayLike | None = None, empty_sentinel: Any = '.', diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py index d8bf1954df94..9ade64648a4e 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -1320,7 +1320,8 @@ def test_nested_user_order(self): assert list(ax_dict) == list("ABCDEFGHI") assert list(fig.axes) == list(ax_dict.values()) - def test_share_all(self): + @pytest.mark.parametrize("share_val", [True, "all"]) + def test_share_all(self, share_val): layout = [ ["A", [["B", "C"], ["D", "E"]]], @@ -1329,11 +1330,65 @@ def test_share_all(self): ["."]]]]] ] fig = plt.figure() - ax_dict = fig.subplot_mosaic(layout, sharex=True, sharey=True) + ax_dict = fig.subplot_mosaic(layout, sharex=share_val, sharey=share_val) ax_dict["A"].set(xscale="log", yscale="logit") assert all(ax.get_xscale() == "log" and ax.get_yscale() == "logit" for ax in ax_dict.values()) + def test_share_row_col(self): + layout = [ + ["A", "B", "C", "D"], + ["E", "F", "C", "D"] + ] + fig = plt.figure() + axd = fig.subplot_mosaic(layout, sharey="row", sharex="col") + + # Testing row sharing for y-axis + axd["A"].set_ylim(0, 50) + axd["C"].set_ylim(-10, 10) + + assert axd["B"].get_ylim() == (0, 50) + assert axd["D"].get_ylim() == (-10, 10) + assert axd["E"].get_ylim() != (0, 50) + + axd["A"].set_xlim(-5, 5) + axd["C"].set_xlim(100, 200) + + assert axd["E"].get_xlim() == (-5, 5) + assert axd["D"].get_xlim() != (100, 200) + + def test_share_invalid(self): + layout = [ + ["A", "B"], + ["C", "D"] + ] + fig = plt.figure() + + with pytest.raises(ValueError, match="must be True, False, 'all', 'row', or 'col'"): + fig.subplot_mosaic(layout, sharex="invalid_string") + + with pytest.raises(ValueError, match="must be True, False, 'all', 'row', or 'col'"): + fig.subplot_mosaic(layout, sharey={"A": "B"}) + + def test_share_row_col_nested(self): + layout = [ + ["A", [["B", "C"], + ["D", "E"]]] + ] + fig = plt.figure() + axd = fig.subplot_mosaic(layout, sharey="row", sharex="col") + + axd["B"].set_ylim(0, 50) + assert axd["C"].get_ylim() == (0, 50) + assert axd["D"].get_ylim() != (0, 50) + + axd["B"].set_xlim(0, 50) + assert axd["D"].get_xlim() == (0, 50) + assert axd["C"].get_xlim() != (0, 50) + + axd["A"].set_ylim(-10, 10) + assert axd["B"].get_ylim() != (-10, 10) + def test_reused_gridspec(): """Test that these all use the same gridspec""" From 1416ea3d38e9148d4cafca96e08e4c5edad7fdd5 Mon Sep 17 00:00:00 2001 From: Nillohit Roy Date: Wed, 7 Oct 2026 20:40:56 +0530 Subject: [PATCH 089/210] Fixed linting errors and updated type hints for issue 18305 --- lib/matplotlib/figure.py | 22 +++++++++++++++------- lib/matplotlib/figure.pyi | 12 ++++++------ lib/matplotlib/pyplot.py | 2 +- lib/matplotlib/tests/test_figure.py | 25 +++++++++++++------------ 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index bafb5b623495..b79eaefcdcb4 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2123,7 +2123,9 @@ def _validate_share_param(param_name, value): return value if value in ["all", "row", "col"]: return value - raise ValueError(f"{param_name} must be True, False, 'all', 'row', or 'col'") + raise ValueError( + f"{param_name} must be True, False, 'all', 'row', or 'col'" + ) sharex = _validate_share_param("sharex", sharex) sharey = _validate_share_param("sharey", sharey) @@ -2299,20 +2301,26 @@ def _do_layout(gs, mosaic, unique_ids, nested): def _apply_sharing(ret_dict, share_val, axis_name): if share_val is False: return - + # Group the axes based on their spans groups = {} for ax in ret_dict.values(): span = ax.get_subplotspec() grid = span.get_gridspec() - + if share_val is True or share_val == "all": groups.setdefault("all", []).append(ax) elif share_val == "row": - groups.setdefault((grid, span.rowspan.start, span.rowspan.stop), []).append(ax) + groups.setdefault( + (grid, span.rowspan.start, span.rowspan.stop), + [] + ).append(ax) elif share_val == "col": - groups.setdefault((grid, span.colspan.start, span.colspan.stop), []).append(ax) - + groups.setdefault( + (grid, span.colspan.start, span.colspan.stop), + [] + ).append(ax) + # Bind the groups together for group in groups.values(): if len(group) > 1: @@ -2322,7 +2330,7 @@ def _apply_sharing(ret_dict, share_val, axis_name): child_ax.sharex(parent) else: child_ax.sharey(parent) - + # Handle tick label visibility per isolated group if axis_name == 'x': # Find the bottom-most edge within a specific group diff --git a/lib/matplotlib/figure.pyi b/lib/matplotlib/figure.pyi index cf17f4694dbd..4046011ad717 100644 --- a/lib/matplotlib/figure.pyi +++ b/lib/matplotlib/figure.pyi @@ -255,8 +255,8 @@ class FigureBase(Artist): self, mosaic: str, *, - sharex: bool = ..., - sharey: bool = ..., + sharex: bool | Literal["all", "row", "col"] = ..., + sharey: bool | Literal["all", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: str = ..., @@ -269,8 +269,8 @@ class FigureBase(Artist): self, mosaic: list[HashableList[T]], *, - sharex: bool = ..., - sharey: bool = ..., + sharex: bool | Literal["all", "row", "col"] = ..., + sharey: bool | Literal["all", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: T = ..., @@ -283,8 +283,8 @@ class FigureBase(Artist): self, mosaic: list[HashableList[Hashable]], *, - sharex: bool = ..., - sharey: bool = ..., + sharex: bool | Literal["all", "row", "col"] = ..., + sharey: bool | Literal["all", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: Any = ..., diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 81a2e759041f..daae7ee0fac6 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -96,7 +96,7 @@ from collections.abc import Callable, Hashable, Iterable, Sequence import pathlib import os - from typing import Any, BinaryIO, Literal + from typing import Any, BinaryIO import PIL.Image from numpy.typing import ArrayLike diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py index 9ade64648a4e..e67e37e51ae7 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -1342,18 +1342,18 @@ def test_share_row_col(self): ] fig = plt.figure() axd = fig.subplot_mosaic(layout, sharey="row", sharex="col") - + # Testing row sharing for y-axis axd["A"].set_ylim(0, 50) axd["C"].set_ylim(-10, 10) - + assert axd["B"].get_ylim() == (0, 50) assert axd["D"].get_ylim() == (-10, 10) assert axd["E"].get_ylim() != (0, 50) - + axd["A"].set_xlim(-5, 5) axd["C"].set_xlim(100, 200) - + assert axd["E"].get_xlim() == (-5, 5) assert axd["D"].get_xlim() != (100, 200) @@ -1363,29 +1363,30 @@ def test_share_invalid(self): ["C", "D"] ] fig = plt.figure() - - with pytest.raises(ValueError, match="must be True, False, 'all', 'row', or 'col'"): + + msg = "must be True, False, 'all', 'row', or 'col'" + with pytest.raises(ValueError, match=msg): fig.subplot_mosaic(layout, sharex="invalid_string") - - with pytest.raises(ValueError, match="must be True, False, 'all', 'row', or 'col'"): + + with pytest.raises(ValueError, match=msg): fig.subplot_mosaic(layout, sharey={"A": "B"}) def test_share_row_col_nested(self): layout = [ - ["A", [["B", "C"], + ["A", [["B", "C"], ["D", "E"]]] ] fig = plt.figure() axd = fig.subplot_mosaic(layout, sharey="row", sharex="col") - + axd["B"].set_ylim(0, 50) assert axd["C"].get_ylim() == (0, 50) assert axd["D"].get_ylim() != (0, 50) - + axd["B"].set_xlim(0, 50) assert axd["D"].get_xlim() == (0, 50) assert axd["C"].get_xlim() != (0, 50) - + axd["A"].set_ylim(-10, 10) assert axd["B"].get_ylim() != (-10, 10) From ed4689ed6d1cbb36bbee2cc7556a2c20b1d54b8f Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Wed, 7 Oct 2026 21:07:15 -0700 Subject: [PATCH 090/210] Unlink openssl@1.1 prior to brew install --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ca6c335ec37b..47f3b415dde5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -172,6 +172,11 @@ jobs: brew unlink ${python_package} brew link --overwrite ${python_package} done + # Remove the stale openssl@1.1 symlink present in the macOS 15 runner image + openssl_link="$(brew --prefix)/bin/openssl" + case "$(readlink "$openssl_link" 2>/dev/null)" in + */openssl@1.1/*) rm -f "$openssl_link" ;; + esac # Workaround for https://github.com/actions/runner-images/issues/10984 brew uninstall --ignore-dependencies --force pkg-config@0.29.2 brew install ccache ffmpeg ghostscript gobject-introspection gtk4 imagemagick ninja From 5b8d5ca5f5703cf997c09665200602ea43326212 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:12:07 +0200 Subject: [PATCH 091/210] DOC: rcParams move timezone to section Other --- lib/matplotlib/rcsetup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 3f5b01e0bae4..bea26f367f07 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1620,13 +1620,6 @@ class _Subsection: validator=_validate_toolbar, description="{None, toolbar2, toolmanager}" ), - _Param( - "timezone", - default="UTC", - type=str, - validator=validate_string, - description="a pytz timezone string, e.g., US/Central or Europe/Paris" - ), _Section( "Lines", description="Default line properties. Some plotting functions such " @@ -3907,6 +3900,14 @@ class _Subsection: "for backward compatibility in testing contexts." ), _Param("backend", None, None, validate_backend), + _Section("Other"), + _Param( + "timezone", + default="UTC", + type=str, + validator=validate_string, + description="a pytz timezone string, e.g., US/Central or Europe/Paris" + ), ] From df1627b8a44cd2a812eb55c70ae4872974773a7e Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:13:26 +0200 Subject: [PATCH 092/210] DOC: rcParams move figure.hooks to section Figure --- lib/matplotlib/rcsetup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index bea26f367f07..1b13a0d8e88b 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1606,13 +1606,6 @@ class _Subsection: type=bool, validator=validate_bool, ), - _Param( - "figure.hooks", - default=[], - type=list[str], - validator=validate_stringlist, - description="list of dotted.module.name:dotted.callable.name" - ), _Param( "toolbar", default="toolbar2", @@ -3258,6 +3251,13 @@ class _Subsection: "figure.subplot.wspace) as constrained_layout already takes " "surrounding texts (titles, labels, # ticklabels) into account." ), + _Param( + "figure.hooks", + default=[], + type=list[str], + validator=validate_stringlist, + description="list of dotted.module.name:dotted.callable.name" + ), _Section("Images"), _Param( "image.aspect", From 2ee1ec37d33adc6f9c6930e09fac4f5769b3dfa7 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:15:47 +0200 Subject: [PATCH 093/210] DOC: rcParams move text.parse_math to section Mathtext and LaTeX --- lib/matplotlib/rcsetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 1b13a0d8e88b..79c8e6cfafa1 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -2037,6 +2037,7 @@ class _Subsection: description="If True (default), the text will be antialiased. This only " "affects raster outputs." ), + _Section("Mathtext and LaTeX"), _Param( "text.parse_math", default=True, @@ -2045,7 +2046,6 @@ class _Subsection: description="Use mathtext if there is an even number of unescaped dollar signs." ), - _Section("Mathtext and LaTeX"), _Param( "text.usetex", default=False, From f704cac72ee0097fc5e7f9a2a50fd53a94eb3bb1 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:16:57 +0200 Subject: [PATCH 094/210] DOC: rcParams move axes3d.snap_rotation to section 3D Axes --- lib/matplotlib/rcsetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 79c8e6cfafa1..18e3c631268a 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -2462,7 +2462,6 @@ class _Subsection: description="trackball border width, in units of the Axes bbox (only for " "'sphere' and 'arcball' style)" ), - _Section("Axis"), _Param( "axes3d.snap_rotation", default=5.0, @@ -2470,6 +2469,7 @@ class _Subsection: validator=validate_float, description="Snap angle (in degrees) for 3D rotation when holding Control." ), + _Section("Axis"), _Param( "xaxis.labellocation", default="center", From 82a4dc4780f71b8440c96e89063b6d9908337935 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:25:07 +0200 Subject: [PATCH 095/210] DOC: rcParams move webagg.* to new section Webagg backend parameters - next to other backends --- lib/matplotlib/rcsetup.py | 59 ++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 18e3c631268a..405ecc56d961 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1562,35 +1562,6 @@ class _Subsection: # In the transition phase, consistency is ensured via tests. _DEFINITION = [ _Section("Backends"), - _Param( - "webagg.port", - default=8988, - type=int, - validator=validate_int, - description="The server port in the WebAgg backend." - ), - _Param( - "webagg.address", - default="127.0.0.1", - type=str, - validator=validate_string, - description="The server address in the WebAgg backend." - ), - _Param( - "webagg.port_retries", - default=50, - type=int, - validator=validate_int, - description="If webagg.port is unavailable, a number of other random ports " - "will be tried until one that is available is found." - ), - _Param( - "webagg.open_in_browser", - default=True, - type=bool, - validator=validate_bool, - description="When True, open the web browser to the plot that is shown." - ), _Param( "backend_fallback", default=True, @@ -3687,6 +3658,36 @@ class _Subsection: validator=["xelatex", "lualatex", "pdflatex"], description="The TeX engine to use for PGF output." ), + _Subsection("Webagg backend parameters"), + _Param( + "webagg.port", + default=8988, + type=int, + validator=validate_int, + description="The server port in the WebAgg backend." + ), + _Param( + "webagg.address", + default="127.0.0.1", + type=str, + validator=validate_string, + description="The server address in the WebAgg backend." + ), + _Param( + "webagg.port_retries", + default=50, + type=int, + validator=validate_int, + description="If webagg.port is unavailable, a number of other random ports " + "will be tried until one that is available is found." + ), + _Param( + "webagg.open_in_browser", + default=True, + type=bool, + validator=validate_bool, + description="When True, open the web browser to the plot that is shown." + ), _Subsection("Docstring parameters"), _Param( "docstring.hardcopy", From 8a2616dd3a590746faeee8ce549e9aa44b1e935a Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:28:13 +0200 Subject: [PATCH 096/210] DOC: rcParams move section "Backend" to all backend subsections previously the backend subsections were under the subsection "Saving figures" --- lib/matplotlib/rcsetup.py | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 405ecc56d961..f17651087741 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1561,29 +1561,6 @@ class _Subsection: # # In the transition phase, consistency is ensured via tests. _DEFINITION = [ - _Section("Backends"), - _Param( - "backend_fallback", - default=True, - type=bool, - validator=validate_bool, - description="If you are running pyplot inside a GUI and your backend choice " - "conflicts, we will automatically try to find a compatible one for " - "you if backend_fallback is True" - ), - _Param( - "interactive", - default=False, - type=bool, - validator=validate_bool, - ), - _Param( - "toolbar", - default="toolbar2", - type=Literal["None", "toolbar2", "toolmanager"], - validator=_validate_toolbar, - description="{None, toolbar2, toolmanager}" - ), _Section( "Lines", description="Default line properties. Some plotting functions such " @@ -3507,6 +3484,29 @@ class _Subsection: description="The page orientation for saved figures, for PostScript output " "only." ), + _Section("Backends"), + _Param( + "backend_fallback", + default=True, + type=bool, + validator=validate_bool, + description="If you are running pyplot inside a GUI and your backend choice " + "conflicts, we will automatically try to find a compatible one for " + "you if backend_fallback is True" + ), + _Param( + "interactive", + default=False, + type=bool, + validator=validate_bool, + ), + _Param( + "toolbar", + default="toolbar2", + type=Literal["None", "toolbar2", "toolmanager"], + validator=_validate_toolbar, + description="{None, toolbar2, toolmanager}" + ), _Subsection("Mac OSX backend parameters"), _Param( "macosx.window_mode", From ea1d246a2c6d4b0c089df30222d2dda0fdc14f45 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:33:54 +0200 Subject: [PATCH 097/210] DOC: rcParams move "docstring.hardcopy" to section "Other" --- lib/matplotlib/rcsetup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index f17651087741..9ea6b6cf8e59 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3689,13 +3689,6 @@ class _Subsection: description="When True, open the web browser to the plot that is shown." ), _Subsection("Docstring parameters"), - _Param( - "docstring.hardcopy", - default=False, - type=bool, - validator=validate_bool, - description="Whether to generate hardcopy docstrings." - ), _Section( "Interactive keymaps", description="Default key mappings for interactive navigation. See " @@ -3902,6 +3895,13 @@ class _Subsection: ), _Param("backend", None, None, validate_backend), _Section("Other"), + _Param( + "docstring.hardcopy", + default=False, + type=bool, + validator=validate_bool, + description="Whether to generate hardcopy docstrings." + ), _Param( "timezone", default="UTC", From d5752aa68e3b21f2cafbd207ccec2e92940995b7 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:35:57 +0200 Subject: [PATCH 098/210] DOC: rcParams move section "Boxplot" next to the other *plot sections --- lib/matplotlib/rcsetup.py | 158 +++++++++++++++++++------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 9ea6b6cf8e59..ded6a4329fc8 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1756,85 +1756,6 @@ class _Subsection: _validate_color_or_edge, description="The color of hatch strokes."), _Param("hatch.linewidth", 1.0, float, validate_float, description="The width of hatch strokes, in points."), - _Section("Boxplot"), - _Param("boxplot.notch", False, bool, validate_bool, - description="Whether to draw notches around the median."), - _Param("boxplot.vertical", True, bool, validate_bool, - description="Whether to draw vertical boxplots."), - _Param("boxplot.whiskers", 1.5, float | tuple[float, float], validate_whiskers, - description="The whisker length as a multiple of the interquartile range, " - "or a (lower, upper) pair."), - _Param("boxplot.bootstrap", None, int | None, validate_int_or_None, - description="The number of bootstrap resamples used to estimate boxplot " - "notches; None disables bootstrapping."), - _Param("boxplot.patchartist", False, bool, validate_bool, - description="Whether boxplots should be drawn as patches instead of line " - "artists."), - _Param("boxplot.showmeans", False, bool, validate_bool, - description="Whether to draw the mean on boxplots."), - _Param("boxplot.showcaps", True, bool, validate_bool, - description="Whether to draw caps on the whiskers."), - _Param("boxplot.showbox", True, bool, validate_bool, - description="Whether to draw the box around the quartiles."), - _Param("boxplot.showfliers", True, bool, validate_bool, - description="Whether to draw flier markers for outliers."), - _Param("boxplot.meanline", False, bool, validate_bool, - description="Whether to draw the mean as a line instead of a marker."), - _Param("boxplot.flierprops.color", "black", ":mpltype:`color`", validate_color, - description="The color of the flier markers."), - _Param("boxplot.flierprops.marker", "o", _MarkerType, _validate_marker, - description="The marker style of flier markers."), - _Param("boxplot.flierprops.markerfacecolor", "none", - ':mpltype:`color` or "auto"', validate_color_or_auto, - description="The face color of flier markers."), - _Param("boxplot.flierprops.markeredgecolor", "black", ':mpltype:`color`', - validate_color, description="The edge color of flier markers."), - _Param("boxplot.flierprops.markeredgewidth", 1.0, float, validate_float, - description="The width of the flier marker edge, in points."), - _Param("boxplot.flierprops.markersize", 6.0, float, validate_float, - description="The flier marker size, in points."), - _Param("boxplot.flierprops.linestyle", "none", _LineStyleType, _validate_linestyle, - description="The line style of flier markers."), - _Param("boxplot.flierprops.linewidth", 1.0, float, validate_float, - description="The line width of flier markers, in points."), - _Param("boxplot.boxprops.color", "black", ':mpltype:`color`', validate_color, - description="The box outline color."), - _Param("boxplot.boxprops.linewidth", 1.0, float, validate_float, - description="The box outline width, in points."), - _Param("boxplot.boxprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The box outline style."), - _Param("boxplot.whiskerprops.color", "black", ':mpltype:`color`', validate_color, - description="The whisker line color."), - _Param("boxplot.whiskerprops.linewidth", 1.0, float, validate_float, - description="The whisker line width, in points."), - _Param("boxplot.whiskerprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The whisker line style."), - _Param("boxplot.capprops.color", "black", ':mpltype:`color`', validate_color, - description="The cap line color."), - _Param("boxplot.capprops.linewidth", 1.0, float, validate_float, - description="The cap line width, in points."), - _Param("boxplot.capprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The cap line style."), - _Param("boxplot.medianprops.color", "C1", ':mpltype:`color`', validate_color, - description="The median line color."), - _Param("boxplot.medianprops.linewidth", 1.0, float, validate_float, - description="The median line width, in points."), - _Param("boxplot.medianprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The median line style."), - _Param("boxplot.meanprops.color", "C2", ':mpltype:`color`', validate_color, - description="The mean marker or line color."), - _Param("boxplot.meanprops.marker", "^", _MarkerType, _validate_marker, - description="The marker style of the mean marker."), - _Param("boxplot.meanprops.markerfacecolor", "C2", ':mpltype:`color`', - validate_color, description="The face color of the mean marker."), - _Param("boxplot.meanprops.markeredgecolor", "C2", ':mpltype:`color`', - validate_color, description="The edge color of the mean marker."), - _Param("boxplot.meanprops.markersize", 6.0, float, validate_float, - description="The mean marker size, in points."), - _Param("boxplot.meanprops.linestyle", "--", _LineStyleType, _validate_linestyle, - description="The line style of the mean marker or line."), - _Param("boxplot.meanprops.linewidth", 1.0, float, validate_float, - description="The line width of the mean marker or line, in points."), _Section( "Font", description="The font properties used by `.Text` " @@ -3339,6 +3260,85 @@ class _Subsection: "define binning strategies. See also the *bins* parameter in " "`~.Axes.hist`." ), + _Section("Boxplot"), + _Param("boxplot.notch", False, bool, validate_bool, + description="Whether to draw notches around the median."), + _Param("boxplot.vertical", True, bool, validate_bool, + description="Whether to draw vertical boxplots."), + _Param("boxplot.whiskers", 1.5, float | tuple[float, float], validate_whiskers, + description="The whisker length as a multiple of the interquartile range, " + "or a (lower, upper) pair."), + _Param("boxplot.bootstrap", None, int | None, validate_int_or_None, + description="The number of bootstrap resamples used to estimate boxplot " + "notches; None disables bootstrapping."), + _Param("boxplot.patchartist", False, bool, validate_bool, + description="Whether boxplots should be drawn as patches instead of line " + "artists."), + _Param("boxplot.showmeans", False, bool, validate_bool, + description="Whether to draw the mean on boxplots."), + _Param("boxplot.showcaps", True, bool, validate_bool, + description="Whether to draw caps on the whiskers."), + _Param("boxplot.showbox", True, bool, validate_bool, + description="Whether to draw the box around the quartiles."), + _Param("boxplot.showfliers", True, bool, validate_bool, + description="Whether to draw flier markers for outliers."), + _Param("boxplot.meanline", False, bool, validate_bool, + description="Whether to draw the mean as a line instead of a marker."), + _Param("boxplot.flierprops.color", "black", ":mpltype:`color`", validate_color, + description="The color of the flier markers."), + _Param("boxplot.flierprops.marker", "o", _MarkerType, _validate_marker, + description="The marker style of flier markers."), + _Param("boxplot.flierprops.markerfacecolor", "none", + ':mpltype:`color` or "auto"', validate_color_or_auto, + description="The face color of flier markers."), + _Param("boxplot.flierprops.markeredgecolor", "black", ':mpltype:`color`', + validate_color, description="The edge color of flier markers."), + _Param("boxplot.flierprops.markeredgewidth", 1.0, float, validate_float, + description="The width of the flier marker edge, in points."), + _Param("boxplot.flierprops.markersize", 6.0, float, validate_float, + description="The flier marker size, in points."), + _Param("boxplot.flierprops.linestyle", "none", _LineStyleType, _validate_linestyle, + description="The line style of flier markers."), + _Param("boxplot.flierprops.linewidth", 1.0, float, validate_float, + description="The line width of flier markers, in points."), + _Param("boxplot.boxprops.color", "black", ':mpltype:`color`', validate_color, + description="The box outline color."), + _Param("boxplot.boxprops.linewidth", 1.0, float, validate_float, + description="The box outline width, in points."), + _Param("boxplot.boxprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The box outline style."), + _Param("boxplot.whiskerprops.color", "black", ':mpltype:`color`', validate_color, + description="The whisker line color."), + _Param("boxplot.whiskerprops.linewidth", 1.0, float, validate_float, + description="The whisker line width, in points."), + _Param("boxplot.whiskerprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The whisker line style."), + _Param("boxplot.capprops.color", "black", ':mpltype:`color`', validate_color, + description="The cap line color."), + _Param("boxplot.capprops.linewidth", 1.0, float, validate_float, + description="The cap line width, in points."), + _Param("boxplot.capprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The cap line style."), + _Param("boxplot.medianprops.color", "C1", ':mpltype:`color`', validate_color, + description="The median line color."), + _Param("boxplot.medianprops.linewidth", 1.0, float, validate_float, + description="The median line width, in points."), + _Param("boxplot.medianprops.linestyle", "-", _LineStyleType, _validate_linestyle, + description="The median line style."), + _Param("boxplot.meanprops.color", "C2", ':mpltype:`color`', validate_color, + description="The mean marker or line color."), + _Param("boxplot.meanprops.marker", "^", _MarkerType, _validate_marker, + description="The marker style of the mean marker."), + _Param("boxplot.meanprops.markerfacecolor", "C2", ':mpltype:`color`', + validate_color, description="The face color of the mean marker."), + _Param("boxplot.meanprops.markeredgecolor", "C2", ':mpltype:`color`', + validate_color, description="The edge color of the mean marker."), + _Param("boxplot.meanprops.markersize", 6.0, float, validate_float, + description="The mean marker size, in points."), + _Param("boxplot.meanprops.linestyle", "--", _LineStyleType, _validate_linestyle, + description="The line style of the mean marker or line."), + _Param("boxplot.meanprops.linewidth", 1.0, float, validate_float, + description="The line width of the mean marker or line, in points."), _Section("Scatter plots"), _Param( "scatter.marker", From ac6aec08f44a35d625357a09473a749b8fbf3b08 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:40:15 +0200 Subject: [PATCH 099/210] DOC: rcParams collect Figure, Axes, ... decorations sections at the top --- lib/matplotlib/rcsetup.py | 1208 ++++++++++++++++++------------------- 1 file changed, 604 insertions(+), 604 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index ded6a4329fc8..952be2c575bb 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1561,458 +1561,195 @@ class _Subsection: # # In the transition phase, consistency is ensured via tests. _DEFINITION = [ - _Section( - "Lines", - description="Default line properties. Some plotting functions such " - "as `~.Axes.plot` may override them with information from the " - "property cycle; see :ref:`color_cycle`." + _Section("Figure"), + _Param( + "figure.titlesize", + default="large", + type=_FontSizeType, + validator=validate_fontsize, + description="size of the figure title (``Figure.suptitle()``)" ), _Param( - "lines.linewidth", - default=1.5, + "figure.titleweight", + default="normal", + type=_FontWeightType, + validator=validate_fontweight, + description="weight of the figure title" + ), + _Param( + "figure.labelsize", + default="large", + type=_FontSizeType, + validator=validate_fontsize, + description="size of the figure label (``Figure.sup[x|y]label()``)" + ), + _Param( + "figure.labelweight", + default="normal", + type=_FontWeightType, + validator=validate_fontweight, + description="weight of the figure label" + ), + _Param( + "figure.figsize", + default=[6.4, 4.8], + type=tuple[float, float], + validator=_listify_validator(validate_float, n=2), + description="figure size in inches" + ), + _Param( + "figure.dpi", + default=100.0, type=float, - validator=validate_float, - description="The default line width in points." + validator=validate_float, description="figure dots per inch" ), _Param( - "lines.linestyle", - default="-", - type=_LineStyleType, - validator=_validate_linestyle, - description="The default line style." + "figure.facecolor", + default="white", + type=":mpltype:`color`", + validator=validate_color, description="figure face color" ), _Param( - "lines.color", - default="C0", + "figure.edgecolor", + default="white", type=":mpltype:`color`", - validator=validate_color, - description="The default line color." + validator=validate_color, description="figure edge color" ), _Param( - "lines.marker", - default="None", - type=_MarkerType, - validator=_validate_marker, - description="The default marker type." + "figure.frameon", + default=True, + type=bool, + validator=validate_bool, description="enable figure frame" ), _Param( - "lines.markerfacecolor", - default="auto", - type=':mpltype:`color` or "auto"', - validator=validate_color_or_auto, - description="The default marker face color; use 'auto' to use 'lines.color'.", + "figure.max_open_warning", + default=20, + type=int, + validator=validate_int, + description="The maximum number of figures to open through the pyplot " + "interface before emitting a warning. If less than one this " + "feature is disabled." ), _Param( - "lines.markeredgecolor", - default="auto", - type=':mpltype:`color` or "auto"', - validator=validate_color_or_auto, - description="The default marker edge color; use 'auto' to use 'lines.color'." + "figure.raise_window", + default=True, + type=bool, + validator=validate_bool, + description="Raise the GUI window to front when show() is called. If set to " + "False, we currently do not take any further actions and whether " + "the window appears on the front may depend on the GUI framework " + "and window manager." ), _Param( - "lines.markeredgewidth", - default=1.0, + "figure.subplot.left", + default=0.125, type=float, validator=validate_float, - description="The default width of the marker edge stroke, in points." + description="the left side of the subplots of the figure" ), _Param( - "lines.markersize", - default=6.0, + "figure.subplot.right", + default=0.9, type=float, validator=validate_float, - description="The default marker size, in points." + description="the right side of the subplots of the figure" ), _Param( - "lines.dash_joinstyle", - default="round", - type=JoinStyle, - validator=JoinStyle, - description="The join style used where dashed line segments meet." + "figure.subplot.bottom", + default=0.11, + type=float, + validator=validate_float, + description="the bottom of the subplots of the figure" ), _Param( - "lines.dash_capstyle", - default="butt", - type=CapStyle, - validator=CapStyle, - description="The cap style used at the ends of dashed line segments." + "figure.subplot.top", + default=0.88, + type=float, + validator=validate_float, + description="the top of the subplots of the figure" ), _Param( - "lines.solid_joinstyle", - default="round", - type=JoinStyle, - validator=JoinStyle, - description="The join style used where solid line segments meet." + "figure.subplot.wspace", + default=0.2, + type=float, + validator=validate_float, + description="the amount of width reserved for space between subplots, " + "expressed as a fraction of the average axis width" ), _Param( - "lines.solid_capstyle", - default="projecting", - type=CapStyle, - validator=CapStyle, - description="The cap style used at the ends of solid lines." + "figure.subplot.hspace", + default=0.2, + type=float, + validator=validate_float, + description="the amount of height reserved for space between subplots, " + "expressed as a fraction of the average axis height" ), _Param( - "lines.antialiased", - default=True, + "figure.autolayout", + default=False, type=bool, validator=validate_bool, - description="Whether to render lines with antialiasing." - ), - _Param( - "lines.dashed_pattern", - default=[3.7, 1.6], - type=list[float], - validator=validate_floatlist, - description="The dash pattern for linestyle 'dashed'." - ), - _Param( - "lines.dashdot_pattern", - default=[6.4, 1.6, 1.0, 1.6], - type=list[float], - validator=validate_floatlist, - description="The dash pattern for linestyle 'dashdot'." - ), - _Param( - "lines.dotted_pattern", - default=[1.0, 1.65], - type=list[float], - validator=validate_floatlist, - description="The dash pattern for linestyle 'dotted'." + description="When True, automatically adjust subplot parameters to make the " + "plot fit the figure using `~.Figure.tight_layout`" ), _Param( - "lines.scale_dashes", - default=True, + "figure.constrained_layout.use", + default=False, type=bool, validator=validate_bool, - description="Whether dash lengths are scaled by the line width." + description="When True, automatically make plot elements fit on the figure. " + '(Not compatible with "figure.autolayout", above).' ), _Param( - "markers.fillstyle", - default="full", - type=Literal["full", "left", "right", "bottom", "top", "none"], - validator=validate_fillstyle, - description="The marker fill style." + "figure.constrained_layout.h_pad", + default=0.04167, + type=float, + validator=validate_float, + description="Padding (in inches) around axes; defaults to 3/72 inches, " + "i.e. 3 points" ), _Param( - "pcolor.shading", - default="auto", - type=Literal["auto", "flat", "nearest", "gouraud"], - validator=["auto", "flat", "nearest", "gouraud"], - description="The default shading mode for `~.Axes.pcolor` and " - "`~.Axes.pcolormesh`." + "figure.constrained_layout.w_pad", + default=0.04167, + type=float, + validator=validate_float, + description="Padding (in inches) around axes; defaults to 3/72 inches, " + "i.e. 3 points" ), _Param( - "pcolormesh.snap", - default=True, - type=bool, - validator=validate_bool, - description="Whether to snap the mesh to pixel boundaries. This is provided " - "solely to allow old test images to remain unchanged. Set to False " - "to obtain the previous behavior." + "figure.constrained_layout.hspace", + default=0.02, + type=float, + validator=validate_float, + description="Spacing between subplots, relative to the subplot sizes. Much " + "smaller than for tight_layout (figure.subplot.hspace, " + "figure.subplot.wspace) as constrained_layout already takes " + "surrounding texts (titles, labels, # ticklabels) into account." ), - _Section("Patches"), _Param( - "patch.linewidth", - default=1.0, + "figure.constrained_layout.wspace", + default=0.02, type=float, validator=validate_float, - description="The patch edge width, in points." + description="Spacing between subplots, relative to the subplot sizes. Much " + "smaller than for tight_layout (figure.subplot.hspace, " + "figure.subplot.wspace) as constrained_layout already takes " + "surrounding texts (titles, labels, # ticklabels) into account." ), _Param( - "patch.facecolor", - default="C0", - type=':mpltype:`color`', - validator=validate_color, - description="The patch face color." + "figure.hooks", + default=[], + type=list[str], + validator=validate_stringlist, + description="list of dotted.module.name:dotted.callable.name" ), + _Section("Axes"), _Param( - "patch.edgecolor", - default="black", - type=':mpltype:`color`', + "axes.facecolor", + default="white", + type=":mpltype:`color`", validator=validate_color, - description='By default, Patches and Collections do not draw edges. This value ' - 'is only used if facecolor is "none" (an Artist without facecolor ' - 'and edgecolor would be invisible) or if patch.force_edgecolor ' - 'is True.' - ), - _Param( - "patch.force_edgecolor", - default=False, - type=bool, - validator=validate_bool, - description="By default, Patches and Collections do not draw edges. Set this " - "to True to draw edges with patch.edgecolor as the default " - "edgecolor. This is mainly relevant for styles." - ), - _Param( - "patch.antialiased", - default=True, - type=bool, - validator=validate_bool, - description="Whether to render patches with antialiasing." - ), - _Section("Hatches"), - _Param("hatch.color", "edge", ':mpltype:`color` or "edge"', - _validate_color_or_edge, description="The color of hatch strokes."), - _Param("hatch.linewidth", 1.0, float, validate_float, - description="The width of hatch strokes, in points."), - _Section( - "Font", - description="The font properties used by `.Text` " - "See https://matplotlib.org/stable/api/font_manager_api.html for " - "more information on font properties. The 6 font properties used " - "for font matching are given below with their default values." - ), - _Param("font.family", ["sans-serif"], list[str], validate_stringlist, - description="A prioritized list of font families to try."), - _Param("font.style", "normal", Literal["normal", "italic", "oblique"], - validate_string, description="The default font style."), - _Param("font.variant", "normal", Literal["normal", "small-caps"], validate_string, - description="The default font variant."), - _Param("font.weight", "normal", _FontWeightType, validator=validate_fontweight, - description="The default font weight."), - _Param("font.stretch", "normal", _FontStretchType, validator=validate_fontstretch, - description="The default font stretch."), - _Param("font.size", 10.0, float, validate_float, - description="The default font size, in points."), - _Param( - "font.serif", - default=[ - "DejaVu Serif", "Bitstream Vera Serif", "Computer Modern Roman", - "New Century Schoolbook", "Century Schoolbook L", "Utopia", "ITC Bookman", - "Bookman", "Nimbus Roman No9 L", "Times New Roman", "Times", "Palatino", - "Charter", "serif", - ], - type=list[str], - validator=validate_stringlist, - description='Fonts to be used for the generic "serif" font family ' - 'specifier, in descending priority.' - ), - _Param( - "font.sans-serif", - default=[ - "DejaVu Sans", "Bitstream Vera Sans", "Computer Modern Sans Serif", - "Lucida Grande", "Verdana", "Geneva", "Lucid", "Arial", "Helvetica", - "Avant Garde", "sans-serif", - ], - type=list[str], - validator=validate_stringlist, - description='Fonts to be used for the generic "sans-serif" font family ' - 'specifier, in descending priority.' - ), - _Param( - "font.cursive", - default=[ - "Apple Chancery", "Textile", "Zapf Chancery", "Sand", "Script MT", "Felipa", - "Comic Neue", "Comic Sans MS", "cursive", - ], - type=list[str], - validator=validate_stringlist, - description='Fonts to be used for the generic "cursive" font family ' - 'specifier, in descending priority.' - ), - _Param( - "font.fantasy", - default=["Chicago", "Charcoal", "Impact", "Western", "xkcd script", "fantasy"], - type=list[str], - validator=validate_stringlist, - description='Fonts to be used for the generic "fantasy" font family ' - 'specifier, in descending priority.' - ), - _Param( - "font.monospace", - default=[ - "DejaVu Sans Mono", "Bitstream Vera Sans Mono", - "Computer Modern Typewriter", "Andale Mono", "Nimbus Mono L", "Courier New", - "Courier", "Fixed", "Terminal", "monospace", - ], - type=list[str], - validator=validate_stringlist, - description='Fonts to be used for the generic "monospace" font family ' - 'specifier, in descending priority.' - ), - _Param( - "font.enable_last_resort", - default=True, - type=bool, - validator=validate_bool, - description="If True, then Unicode Consortium's Last Resort font will be " - "appended to all font selections. This ensures that there will " - "always be a glyph displayed." - ), - _Section("Text properties"), - _Param( - "text.color", - default="black", - type=":mpltype:`color`", - validator=validate_color, - description="The default text color." - ), - _Param( - "text.language", - default=None, - type=str | None, - validator=validate_string_or_None, - description="The language of the text in a format accepted by libraqm, namely " - "`a BCP47 language code " - "`_. If " - "None, then no particular language will be implied, and default " - "font settings will be used." - ), - _Param( - "text.hinting", - default="default", - type=Literal[ - "default", "no_autohint", "force_autohint", "no_hinting", "auto", "native", - "either", "none", - ], - validator=[ - "default", "no_autohint", "force_autohint", "no_hinting", "auto", "native", - "either", "none", - ], - description="FreeType hinting flag (\"foo\" corresponds to FT_LOAD_FOO); may " - "be one of the following (Proprietary Matplotlib-specific synonyms " - "are given in parentheses, but their use is discouraged): " - "- default: Use the font's native hinter if possible, else " - " FreeType's auto-hinter. (\"either\" is a synonym)." - "- no_autohint: Use the font's native hinter if possible, else " - " don't hint. (\"native\" is a synonym.)" - "- force_autohint: Use FreeType's auto-hinter. (\"auto\" is a " - " synonym.)" - "- no_hinting: Disable hinting. (\"none\" is a synonym.)" - ), - _Param( - "text.hinting_factor", - default=None, - type=int | None, - validator=validate_int_or_None, - description="[DEPRECATED] This setting has no effect." - ), - _Param( - "text.kerning_factor", - default=None, - type=int | None, - validator=validate_int_or_None, - description="[DEPRECATED] Specifies the scaling factor for kerning values. " - "This is provided solely to allow old test images to remain " - "unchanged. Set to 6 to obtain previous behavior. Values other " - "than 0 or 6 have no defined meaning." - ), - _Param( - "text.antialiased", - default=True, - type=bool, - validator=validate_bool, - description="If True (default), the text will be antialiased. This only " - "affects raster outputs." - ), - _Section("Mathtext and LaTeX"), - _Param( - "text.parse_math", - default=True, - type=bool, - validator=validate_bool, - description="Use mathtext if there is an even number of unescaped dollar signs." - - ), - _Param( - "text.usetex", - default=False, - type=bool, - validator=validate_bool, - description="use latex for all text handling. The following fonts are " - "supported through the usual rc parameter settings: " - "new century schoolbook, bookman, times, palatino, zapf chancery, " - "charter, serif, sans-serif, helvetica, avant garde, courier, " - "monospace, computer modern roman, computer modern sans serif, " - "computer modern typewriter" - ), - _Param( - "text.latex.engine", - default="latex", - type=Literal["latex", "latex+dvipng"], - validator=["latex", "latex+dvipng"], - description=( - "The TeX engine/format to use. The following values are supported:\n" - "- 'latex': The classic TeX engine (the current default). All backends " - "render TeX's output by parsing the DVI output into glyphs and boxes and " - "emitting those one by one.\n" - "- 'latex+dvipng': The same as 'latex', with the exception that Agg-based " - "backends rely on dvipng to rasterize TeX's output. This value was the " - "default up to Matplotlib 3.10." - ) - ), - _Param( - "text.latex.preamble", - default="", - type=str, - validator=validate_string, - description='IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES AND IS ' - 'THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP IF THIS FEATURE ' - 'DOES NOT DO WHAT YOU EXPECT IT TO. text.latex.preamble is a ' - 'single line of LaTeX code that will be passed on to the LaTeX ' - 'system. It may contain any code that is valid for the LaTeX ' - '"preamble", i.e. between the "\\documentclass" and ' - '"\\begin{document}" statements. Note that it has to be put on a ' - 'single line, which may become quite long. The following packages ' - 'are always loaded with usetex, so beware of package collisions: ' - ' color, fix-cm, geometry, graphicx, textcomp. PostScript ' - '(PSNFSS) font packages may also be loaded, depending on your font ' - 'settings.' - ), - _Param( - "mathtext.fontset", - default="dejavusans", - type=Literal["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], - validator=["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], - description="Should be 'dejavusans' (default), 'dejavuserif', " - "'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'" - ), - _Param("mathtext.bf", "sans:bold", str, validate_font_properties, - description="The font config pattern for bold math text."), - _Param("mathtext.bfit", "sans:italic:bold", str, validate_font_properties, - description="The font config pattern for bold italic math text."), - _Param("mathtext.cal", "cursive", str, validate_font_properties, - description="The font config pattern for calligraphic math text."), - _Param("mathtext.it", "sans:italic", str, validate_font_properties, - description="The font config pattern for italic math text."), - _Param("mathtext.rm", "sans", str, validate_font_properties, - description="The font config pattern for roman math text."), - _Param("mathtext.sf", "sans", str, validate_font_properties, - description="The font config pattern for sans-serif math text."), - _Param("mathtext.tt", "monospace", str, validate_font_properties, - description="The font config pattern for monospace math text."), - _Param( - "mathtext.fallback", - default="cm", - type=Literal["cm", "stix", "stixsans"] | None, - validator=_validate_mathtext_fallback, - description="Select fallback font from ['cm' (Computer Modern), 'stix', " - "'stixsans'] when a symbol cannot be found in one of the custom " - "math fonts. Select 'None' to not perform fallback and replace the " - "missing character by a dummy symbol." - ), - _Param( - "mathtext.default", - default="normal", - type=Literal[ - "rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", "scr", - "regular", "normal", - ], - validator=["rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", - "scr", "regular", "normal"], - description=( - 'The default font for math-formatted text. Can be any of the LaTeX font ' - 'names, including the special name "regular" for the same font used in ' - 'regular text.'), - ), - _Section("Axes"), - _Param( - "axes.facecolor", - default="white", - type=":mpltype:`color`", - validator=validate_color, - description="The axes background color." + description="The axes background color." ), _Param( "axes.edgecolor", @@ -2838,294 +2575,557 @@ class _Subsection: "patch.linewidth" ), _Param( - "legend.fancybox", - default=True, - type=bool, - validator=validate_bool, - description="if True, use a rounded box for the legend background, else a " - "rectangle" + "legend.fancybox", + default=True, + type=bool, + validator=validate_bool, + description="if True, use a rounded box for the legend background, else a " + "rectangle" + ), + _Param( + "legend.shadow", + default=False, + type=bool, + validator=validate_bool, + description="if True, give background a shadow effect" + ), + _Param( + "legend.numpoints", + default=1, + type=int, + validator=validate_int, + description="the number of marker points in the legend line" + ), + _Param( + "legend.scatterpoints", + default=1, + type=int, + validator=validate_int, + description="number of scatter points" + ), + _Param( + "legend.markerscale", + default=1.0, + type=float, + validator=validate_float, + description="the relative size of legend markers vs. original" + ), + _Param( + "legend.fontsize", + default="medium", + type=_FontSizeType, + validator=validate_fontsize, + description="The font size of legend text." + ), + _Param( + "legend.labelcolor", + default="None", + type=':mpltype:`color` or {"linecolor", "markerfacecolor", "markeredgecolor"}', + validator=_validate_color_or_linecolor, + description="The color of the labels in legend entries. The special values " + "'linecolor', 'markerfacecolor', and 'markeredgecolor' " + "infer the color from the associated legend handle; i.e. using " + "'linecolor' will render the label of a red line also in red." + ), + _Param( + "legend.title_fontsize", + default=None, + type=_FontSizeType | None, + validator=validate_fontsize_None, + description="None sets to the same as the default axes." + ), + _Param( + "legend.borderpad", + default=0.4, + type=float, + validator=validate_float, + description="border whitespace" + ), + _Param( + "legend.labelspacing", + default=0.5, + type=float, + validator=validate_float, + description="the vertical space between the legend entries" + ), + _Param( + "legend.handlelength", + default=2.0, + type=float, + validator=validate_float, + description="the length of the legend lines" + ), + _Param( + "legend.handleheight", + default=0.7, + type=float, + validator=validate_float, + description="the height of the legend handle" + ), + _Param( + "legend.handletextpad", + default=0.8, + type=float, + validator=validate_float, + description="the space between the legend line and legend text" + ), + _Param( + "legend.borderaxespad", + default=0.5, + type=float, + validator=validate_float, + description="the border between the axes and legend edge" + ), + _Param( + "legend.columnspacing", + default=2.0, + type=float, + validator=validate_float, description="column separation" + ), + _Section( + "Lines", + description="Default line properties. Some plotting functions such " + "as `~.Axes.plot` may override them with information from the " + "property cycle; see :ref:`color_cycle`." + ), + _Param( + "lines.linewidth", + default=1.5, + type=float, + validator=validate_float, + description="The default line width in points." + ), + _Param( + "lines.linestyle", + default="-", + type=_LineStyleType, + validator=_validate_linestyle, + description="The default line style." + ), + _Param( + "lines.color", + default="C0", + type=":mpltype:`color`", + validator=validate_color, + description="The default line color." + ), + _Param( + "lines.marker", + default="None", + type=_MarkerType, + validator=_validate_marker, + description="The default marker type." + ), + _Param( + "lines.markerfacecolor", + default="auto", + type=':mpltype:`color` or "auto"', + validator=validate_color_or_auto, + description="The default marker face color; use 'auto' to use 'lines.color'.", + ), + _Param( + "lines.markeredgecolor", + default="auto", + type=':mpltype:`color` or "auto"', + validator=validate_color_or_auto, + description="The default marker edge color; use 'auto' to use 'lines.color'." + ), + _Param( + "lines.markeredgewidth", + default=1.0, + type=float, + validator=validate_float, + description="The default width of the marker edge stroke, in points." + ), + _Param( + "lines.markersize", + default=6.0, + type=float, + validator=validate_float, + description="The default marker size, in points." ), _Param( - "legend.shadow", - default=False, - type=bool, - validator=validate_bool, - description="if True, give background a shadow effect" + "lines.dash_joinstyle", + default="round", + type=JoinStyle, + validator=JoinStyle, + description="The join style used where dashed line segments meet." ), _Param( - "legend.numpoints", - default=1, - type=int, - validator=validate_int, - description="the number of marker points in the legend line" + "lines.dash_capstyle", + default="butt", + type=CapStyle, + validator=CapStyle, + description="The cap style used at the ends of dashed line segments." ), _Param( - "legend.scatterpoints", - default=1, - type=int, - validator=validate_int, - description="number of scatter points" + "lines.solid_joinstyle", + default="round", + type=JoinStyle, + validator=JoinStyle, + description="The join style used where solid line segments meet." ), _Param( - "legend.markerscale", - default=1.0, - type=float, - validator=validate_float, - description="the relative size of legend markers vs. original" + "lines.solid_capstyle", + default="projecting", + type=CapStyle, + validator=CapStyle, + description="The cap style used at the ends of solid lines." ), _Param( - "legend.fontsize", - default="medium", - type=_FontSizeType, - validator=validate_fontsize, - description="The font size of legend text." + "lines.antialiased", + default=True, + type=bool, + validator=validate_bool, + description="Whether to render lines with antialiasing." ), _Param( - "legend.labelcolor", - default="None", - type=':mpltype:`color` or {"linecolor", "markerfacecolor", "markeredgecolor"}', - validator=_validate_color_or_linecolor, - description="The color of the labels in legend entries. The special values " - "'linecolor', 'markerfacecolor', and 'markeredgecolor' " - "infer the color from the associated legend handle; i.e. using " - "'linecolor' will render the label of a red line also in red." + "lines.dashed_pattern", + default=[3.7, 1.6], + type=list[float], + validator=validate_floatlist, + description="The dash pattern for linestyle 'dashed'." ), _Param( - "legend.title_fontsize", - default=None, - type=_FontSizeType | None, - validator=validate_fontsize_None, - description="None sets to the same as the default axes." + "lines.dashdot_pattern", + default=[6.4, 1.6, 1.0, 1.6], + type=list[float], + validator=validate_floatlist, + description="The dash pattern for linestyle 'dashdot'." ), _Param( - "legend.borderpad", - default=0.4, - type=float, - validator=validate_float, - description="border whitespace" + "lines.dotted_pattern", + default=[1.0, 1.65], + type=list[float], + validator=validate_floatlist, + description="The dash pattern for linestyle 'dotted'." ), _Param( - "legend.labelspacing", - default=0.5, - type=float, - validator=validate_float, - description="the vertical space between the legend entries" + "lines.scale_dashes", + default=True, + type=bool, + validator=validate_bool, + description="Whether dash lengths are scaled by the line width." ), _Param( - "legend.handlelength", - default=2.0, - type=float, - validator=validate_float, - description="the length of the legend lines" + "markers.fillstyle", + default="full", + type=Literal["full", "left", "right", "bottom", "top", "none"], + validator=validate_fillstyle, + description="The marker fill style." ), _Param( - "legend.handleheight", - default=0.7, - type=float, - validator=validate_float, - description="the height of the legend handle" + "pcolor.shading", + default="auto", + type=Literal["auto", "flat", "nearest", "gouraud"], + validator=["auto", "flat", "nearest", "gouraud"], + description="The default shading mode for `~.Axes.pcolor` and " + "`~.Axes.pcolormesh`." ), _Param( - "legend.handletextpad", - default=0.8, - type=float, - validator=validate_float, - description="the space between the legend line and legend text" + "pcolormesh.snap", + default=True, + type=bool, + validator=validate_bool, + description="Whether to snap the mesh to pixel boundaries. This is provided " + "solely to allow old test images to remain unchanged. Set to False " + "to obtain the previous behavior." ), + _Section("Patches"), _Param( - "legend.borderaxespad", - default=0.5, + "patch.linewidth", + default=1.0, type=float, validator=validate_float, - description="the border between the axes and legend edge" - ), - _Param( - "legend.columnspacing", - default=2.0, - type=float, - validator=validate_float, description="column separation" + description="The patch edge width, in points." ), - _Section("Figure"), _Param( - "figure.titlesize", - default="large", - type=_FontSizeType, - validator=validate_fontsize, - description="size of the figure title (``Figure.suptitle()``)" + "patch.facecolor", + default="C0", + type=':mpltype:`color`', + validator=validate_color, + description="The patch face color." ), _Param( - "figure.titleweight", - default="normal", - type=_FontWeightType, - validator=validate_fontweight, - description="weight of the figure title" + "patch.edgecolor", + default="black", + type=':mpltype:`color`', + validator=validate_color, + description='By default, Patches and Collections do not draw edges. This value ' + 'is only used if facecolor is "none" (an Artist without facecolor ' + 'and edgecolor would be invisible) or if patch.force_edgecolor ' + 'is True.' ), _Param( - "figure.labelsize", - default="large", - type=_FontSizeType, - validator=validate_fontsize, - description="size of the figure label (``Figure.sup[x|y]label()``)" + "patch.force_edgecolor", + default=False, + type=bool, + validator=validate_bool, + description="By default, Patches and Collections do not draw edges. Set this " + "to True to draw edges with patch.edgecolor as the default " + "edgecolor. This is mainly relevant for styles." ), _Param( - "figure.labelweight", - default="normal", - type=_FontWeightType, - validator=validate_fontweight, - description="weight of the figure label" + "patch.antialiased", + default=True, + type=bool, + validator=validate_bool, + description="Whether to render patches with antialiasing." ), - _Param( - "figure.figsize", - default=[6.4, 4.8], - type=tuple[float, float], - validator=_listify_validator(validate_float, n=2), - description="figure size in inches" + _Section("Hatches"), + _Param("hatch.color", "edge", ':mpltype:`color` or "edge"', + _validate_color_or_edge, description="The color of hatch strokes."), + _Param("hatch.linewidth", 1.0, float, validate_float, + description="The width of hatch strokes, in points."), + _Section( + "Font", + description="The font properties used by `.Text` " + "See https://matplotlib.org/stable/api/font_manager_api.html for " + "more information on font properties. The 6 font properties used " + "for font matching are given below with their default values." ), + _Param("font.family", ["sans-serif"], list[str], validate_stringlist, + description="A prioritized list of font families to try."), + _Param("font.style", "normal", Literal["normal", "italic", "oblique"], + validate_string, description="The default font style."), + _Param("font.variant", "normal", Literal["normal", "small-caps"], validate_string, + description="The default font variant."), + _Param("font.weight", "normal", _FontWeightType, validator=validate_fontweight, + description="The default font weight."), + _Param("font.stretch", "normal", _FontStretchType, validator=validate_fontstretch, + description="The default font stretch."), + _Param("font.size", 10.0, float, validate_float, + description="The default font size, in points."), _Param( - "figure.dpi", - default=100.0, - type=float, - validator=validate_float, description="figure dots per inch" + "font.serif", + default=[ + "DejaVu Serif", "Bitstream Vera Serif", "Computer Modern Roman", + "New Century Schoolbook", "Century Schoolbook L", "Utopia", "ITC Bookman", + "Bookman", "Nimbus Roman No9 L", "Times New Roman", "Times", "Palatino", + "Charter", "serif", + ], + type=list[str], + validator=validate_stringlist, + description='Fonts to be used for the generic "serif" font family ' + 'specifier, in descending priority.' ), _Param( - "figure.facecolor", - default="white", - type=":mpltype:`color`", - validator=validate_color, description="figure face color" + "font.sans-serif", + default=[ + "DejaVu Sans", "Bitstream Vera Sans", "Computer Modern Sans Serif", + "Lucida Grande", "Verdana", "Geneva", "Lucid", "Arial", "Helvetica", + "Avant Garde", "sans-serif", + ], + type=list[str], + validator=validate_stringlist, + description='Fonts to be used for the generic "sans-serif" font family ' + 'specifier, in descending priority.' ), _Param( - "figure.edgecolor", - default="white", - type=":mpltype:`color`", - validator=validate_color, description="figure edge color" + "font.cursive", + default=[ + "Apple Chancery", "Textile", "Zapf Chancery", "Sand", "Script MT", "Felipa", + "Comic Neue", "Comic Sans MS", "cursive", + ], + type=list[str], + validator=validate_stringlist, + description='Fonts to be used for the generic "cursive" font family ' + 'specifier, in descending priority.' ), _Param( - "figure.frameon", - default=True, - type=bool, - validator=validate_bool, description="enable figure frame" + "font.fantasy", + default=["Chicago", "Charcoal", "Impact", "Western", "xkcd script", "fantasy"], + type=list[str], + validator=validate_stringlist, + description='Fonts to be used for the generic "fantasy" font family ' + 'specifier, in descending priority.' ), _Param( - "figure.max_open_warning", - default=20, - type=int, - validator=validate_int, - description="The maximum number of figures to open through the pyplot " - "interface before emitting a warning. If less than one this " - "feature is disabled." + "font.monospace", + default=[ + "DejaVu Sans Mono", "Bitstream Vera Sans Mono", + "Computer Modern Typewriter", "Andale Mono", "Nimbus Mono L", "Courier New", + "Courier", "Fixed", "Terminal", "monospace", + ], + type=list[str], + validator=validate_stringlist, + description='Fonts to be used for the generic "monospace" font family ' + 'specifier, in descending priority.' ), _Param( - "figure.raise_window", + "font.enable_last_resort", default=True, type=bool, validator=validate_bool, - description="Raise the GUI window to front when show() is called. If set to " - "False, we currently do not take any further actions and whether " - "the window appears on the front may depend on the GUI framework " - "and window manager." + description="If True, then Unicode Consortium's Last Resort font will be " + "appended to all font selections. This ensures that there will " + "always be a glyph displayed." ), + _Section("Text properties"), _Param( - "figure.subplot.left", - default=0.125, - type=float, - validator=validate_float, - description="the left side of the subplots of the figure" + "text.color", + default="black", + type=":mpltype:`color`", + validator=validate_color, + description="The default text color." ), _Param( - "figure.subplot.right", - default=0.9, - type=float, - validator=validate_float, - description="the right side of the subplots of the figure" + "text.language", + default=None, + type=str | None, + validator=validate_string_or_None, + description="The language of the text in a format accepted by libraqm, namely " + "`a BCP47 language code " + "`_. If " + "None, then no particular language will be implied, and default " + "font settings will be used." ), _Param( - "figure.subplot.bottom", - default=0.11, - type=float, - validator=validate_float, - description="the bottom of the subplots of the figure" + "text.hinting", + default="default", + type=Literal[ + "default", "no_autohint", "force_autohint", "no_hinting", "auto", "native", + "either", "none", + ], + validator=[ + "default", "no_autohint", "force_autohint", "no_hinting", "auto", "native", + "either", "none", + ], + description="FreeType hinting flag (\"foo\" corresponds to FT_LOAD_FOO); may " + "be one of the following (Proprietary Matplotlib-specific synonyms " + "are given in parentheses, but their use is discouraged): " + "- default: Use the font's native hinter if possible, else " + " FreeType's auto-hinter. (\"either\" is a synonym)." + "- no_autohint: Use the font's native hinter if possible, else " + " don't hint. (\"native\" is a synonym.)" + "- force_autohint: Use FreeType's auto-hinter. (\"auto\" is a " + " synonym.)" + "- no_hinting: Disable hinting. (\"none\" is a synonym.)" ), _Param( - "figure.subplot.top", - default=0.88, - type=float, - validator=validate_float, - description="the top of the subplots of the figure" + "text.hinting_factor", + default=None, + type=int | None, + validator=validate_int_or_None, + description="[DEPRECATED] This setting has no effect." ), _Param( - "figure.subplot.wspace", - default=0.2, - type=float, - validator=validate_float, - description="the amount of width reserved for space between subplots, " - "expressed as a fraction of the average axis width" + "text.kerning_factor", + default=None, + type=int | None, + validator=validate_int_or_None, + description="[DEPRECATED] Specifies the scaling factor for kerning values. " + "This is provided solely to allow old test images to remain " + "unchanged. Set to 6 to obtain previous behavior. Values other " + "than 0 or 6 have no defined meaning." ), _Param( - "figure.subplot.hspace", - default=0.2, - type=float, - validator=validate_float, - description="the amount of height reserved for space between subplots, " - "expressed as a fraction of the average axis height" + "text.antialiased", + default=True, + type=bool, + validator=validate_bool, + description="If True (default), the text will be antialiased. This only " + "affects raster outputs." ), + _Section("Mathtext and LaTeX"), _Param( - "figure.autolayout", - default=False, + "text.parse_math", + default=True, type=bool, validator=validate_bool, - description="When True, automatically adjust subplot parameters to make the " - "plot fit the figure using `~.Figure.tight_layout`" + description="Use mathtext if there is an even number of unescaped dollar signs." + ), _Param( - "figure.constrained_layout.use", + "text.usetex", default=False, type=bool, validator=validate_bool, - description="When True, automatically make plot elements fit on the figure. " - '(Not compatible with "figure.autolayout", above).' + description="use latex for all text handling. The following fonts are " + "supported through the usual rc parameter settings: " + "new century schoolbook, bookman, times, palatino, zapf chancery, " + "charter, serif, sans-serif, helvetica, avant garde, courier, " + "monospace, computer modern roman, computer modern sans serif, " + "computer modern typewriter" ), _Param( - "figure.constrained_layout.h_pad", - default=0.04167, - type=float, - validator=validate_float, - description="Padding (in inches) around axes; defaults to 3/72 inches, " - "i.e. 3 points" + "text.latex.engine", + default="latex", + type=Literal["latex", "latex+dvipng"], + validator=["latex", "latex+dvipng"], + description=( + "The TeX engine/format to use. The following values are supported:\n" + "- 'latex': The classic TeX engine (the current default). All backends " + "render TeX's output by parsing the DVI output into glyphs and boxes and " + "emitting those one by one.\n" + "- 'latex+dvipng': The same as 'latex', with the exception that Agg-based " + "backends rely on dvipng to rasterize TeX's output. This value was the " + "default up to Matplotlib 3.10." + ) ), _Param( - "figure.constrained_layout.w_pad", - default=0.04167, - type=float, - validator=validate_float, - description="Padding (in inches) around axes; defaults to 3/72 inches, " - "i.e. 3 points" + "text.latex.preamble", + default="", + type=str, + validator=validate_string, + description='IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES AND IS ' + 'THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP IF THIS FEATURE ' + 'DOES NOT DO WHAT YOU EXPECT IT TO. text.latex.preamble is a ' + 'single line of LaTeX code that will be passed on to the LaTeX ' + 'system. It may contain any code that is valid for the LaTeX ' + '"preamble", i.e. between the "\\documentclass" and ' + '"\\begin{document}" statements. Note that it has to be put on a ' + 'single line, which may become quite long. The following packages ' + 'are always loaded with usetex, so beware of package collisions: ' + ' color, fix-cm, geometry, graphicx, textcomp. PostScript ' + '(PSNFSS) font packages may also be loaded, depending on your font ' + 'settings.' ), _Param( - "figure.constrained_layout.hspace", - default=0.02, - type=float, - validator=validate_float, - description="Spacing between subplots, relative to the subplot sizes. Much " - "smaller than for tight_layout (figure.subplot.hspace, " - "figure.subplot.wspace) as constrained_layout already takes " - "surrounding texts (titles, labels, # ticklabels) into account." + "mathtext.fontset", + default="dejavusans", + type=Literal["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], + validator=["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], + description="Should be 'dejavusans' (default), 'dejavuserif', " + "'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'" ), + _Param("mathtext.bf", "sans:bold", str, validate_font_properties, + description="The font config pattern for bold math text."), + _Param("mathtext.bfit", "sans:italic:bold", str, validate_font_properties, + description="The font config pattern for bold italic math text."), + _Param("mathtext.cal", "cursive", str, validate_font_properties, + description="The font config pattern for calligraphic math text."), + _Param("mathtext.it", "sans:italic", str, validate_font_properties, + description="The font config pattern for italic math text."), + _Param("mathtext.rm", "sans", str, validate_font_properties, + description="The font config pattern for roman math text."), + _Param("mathtext.sf", "sans", str, validate_font_properties, + description="The font config pattern for sans-serif math text."), + _Param("mathtext.tt", "monospace", str, validate_font_properties, + description="The font config pattern for monospace math text."), _Param( - "figure.constrained_layout.wspace", - default=0.02, - type=float, - validator=validate_float, - description="Spacing between subplots, relative to the subplot sizes. Much " - "smaller than for tight_layout (figure.subplot.hspace, " - "figure.subplot.wspace) as constrained_layout already takes " - "surrounding texts (titles, labels, # ticklabels) into account." + "mathtext.fallback", + default="cm", + type=Literal["cm", "stix", "stixsans"] | None, + validator=_validate_mathtext_fallback, + description="Select fallback font from ['cm' (Computer Modern), 'stix', " + "'stixsans'] when a symbol cannot be found in one of the custom " + "math fonts. Select 'None' to not perform fallback and replace the " + "missing character by a dummy symbol." ), _Param( - "figure.hooks", - default=[], - type=list[str], - validator=validate_stringlist, - description="list of dotted.module.name:dotted.callable.name" + "mathtext.default", + default="normal", + type=Literal[ + "rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", "scr", + "regular", "normal", + ], + validator=["rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", + "scr", "regular", "normal"], + description=( + 'The default font for math-formatted text. Can be any of the LaTeX font ' + 'names, including the special name "regular" for the same font used in ' + 'regular text.'), ), _Section("Images"), _Param( From 3bc622e6f55bc552af205fbb97cffc1e59b9500d Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:41:45 +0200 Subject: [PATCH 100/210] DOC: rcParams make "AGG rendering" a subsection of "Backends" --- lib/matplotlib/rcsetup.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 952be2c575bb..6375a236c4f8 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3354,18 +3354,6 @@ class _Subsection: validator=validate_string, description="The default edge color behavior for scatter plots." ), - _Section("AGG rendering"), - _Param( - "agg.path.chunksize", - default=0, - type=int, - validator=validate_int, - description="0 to disable; values in the range 10000 to 100000 can improve " - "speed slightly and prevent an Agg rendering failure when plotting " - "very large data sets, especially if they are very gappy. It may " - "cause minor artifacts, though. A value of 20000 is probably a " - "good starting point." - ), _Section("Paths"), _Param( "path.simplify", @@ -3507,6 +3495,18 @@ class _Subsection: validator=_validate_toolbar, description="{None, toolbar2, toolmanager}" ), + _Subsection("AGG rendering"), + _Param( + "agg.path.chunksize", + default=0, + type=int, + validator=validate_int, + description="0 to disable; values in the range 10000 to 100000 can improve " + "speed slightly and prevent an Agg rendering failure when plotting " + "very large data sets, especially if they are very gappy. It may " + "cause minor artifacts, though. A value of 20000 is probably a " + "good starting point." + ), _Subsection("Mac OSX backend parameters"), _Param( "macosx.window_mode", From 2b529540b434672355b00d3a8e09dc1f8434572f Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:43:41 +0200 Subject: [PATCH 101/210] DOC: rcParams move section "Paths" next to the other Artist-related sections ("Lines", "Patches", ...) --- lib/matplotlib/rcsetup.py | 90 +++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 6375a236c4f8..0cec4166b746 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -2872,6 +2872,51 @@ class _Subsection: validator=validate_bool, description="Whether to render patches with antialiasing." ), + _Section("Paths"), + _Param( + "path.simplify", + default=True, + type=bool, + validator=validate_bool, + description='When True, simplify paths by removing "invisible" points to ' + 'reduce file size and increase rendering speed', + ), + _Param( + "path.simplify_threshold", + default=0.111111111111, + type=float, + validator=_validate_greaterequal0_lessequal1, + description="The threshold of similarity below which vertices will be removed " + "in the simplification process." + ), + _Param( + "path.snap", + default=True, + type=bool, + validator=validate_bool, + description="When True, rectilinear axis-aligned paths will be snapped to the " + "nearest pixel when certain criteria are met. When False, paths " + "will never be snapped." + ), + _Param( + "path.sketch", + default=None, + type=tuple[float, float, float] | None, + validator=validate_sketch, + description="May be None, or a tuple of the form:" + "path.sketch: (scale, length, randomness)" + "- *scale* is the amplitude of the wiggle perpendicular to the line" + " (in pixels)." + "- *length* is the length of the wiggle along the line (in pixels)." + "- *randomness* is the factor by which the length is randomly " + " scaled." + ), + _Param( + "path.effects", + default=[], + type=list, + validator=validate_anylist + ), _Section("Hatches"), _Param("hatch.color", "edge", ':mpltype:`color` or "edge"', _validate_color_or_edge, description="The color of hatch strokes."), @@ -3354,51 +3399,6 @@ class _Subsection: validator=validate_string, description="The default edge color behavior for scatter plots." ), - _Section("Paths"), - _Param( - "path.simplify", - default=True, - type=bool, - validator=validate_bool, - description='When True, simplify paths by removing "invisible" points to ' - 'reduce file size and increase rendering speed', - ), - _Param( - "path.simplify_threshold", - default=0.111111111111, - type=float, - validator=_validate_greaterequal0_lessequal1, - description="The threshold of similarity below which vertices will be removed " - "in the simplification process." - ), - _Param( - "path.snap", - default=True, - type=bool, - validator=validate_bool, - description="When True, rectilinear axis-aligned paths will be snapped to the " - "nearest pixel when certain criteria are met. When False, paths " - "will never be snapped." - ), - _Param( - "path.sketch", - default=None, - type=tuple[float, float, float] | None, - validator=validate_sketch, - description="May be None, or a tuple of the form:" - "path.sketch: (scale, length, randomness)" - "- *scale* is the amplitude of the wiggle perpendicular to the line" - " (in pixels)." - "- *length* is the length of the wiggle along the line (in pixels)." - "- *randomness* is the factor by which the length is randomly " - " scaled." - ), - _Param( - "path.effects", - default=[], - type=list, - validator=validate_anylist - ), _Section("Saving figures"), _Param( "savefig.dpi", From bc8c83dc585e0bf45f726951f4161bf2161d7e07 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:46:26 +0200 Subject: [PATCH 102/210] DOC: rcParams move "backend" into section "Backends" --- lib/matplotlib/rcsetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 0cec4166b746..7f0d97832aba 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3473,6 +3473,7 @@ class _Subsection: "only." ), _Section("Backends"), + _Param("backend", None, None, validate_backend), _Param( "backend_fallback", default=True, @@ -3893,7 +3894,6 @@ class _Subsection: description="Whether classic Matplotlib defaults are enabled. This is mainly " "for backward compatibility in testing contexts." ), - _Param("backend", None, None, validate_backend), _Section("Other"), _Param( "docstring.hardcopy", From 221959560ccf5d1266b2837e7292bd9b3b14d079 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:46:55 +0200 Subject: [PATCH 103/210] DOC: rcParams move "_internal.classic_mode" into section "Others" --- lib/matplotlib/rcsetup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 7f0d97832aba..b46edba9b2f0 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3886,6 +3886,7 @@ class _Subsection: description="The maximum Base64-encoded animation size, in MB, for HTML " "output such as IPython notebooks." ), + _Section("Other"), _Param( "_internal.classic_mode", default=False, @@ -3894,7 +3895,6 @@ class _Subsection: description="Whether classic Matplotlib defaults are enabled. This is mainly " "for backward compatibility in testing contexts." ), - _Section("Other"), _Param( "docstring.hardcopy", default=False, From 6fe438398f0a236337fccc0da636982ef5bbc004 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:49:35 +0200 Subject: [PATCH 104/210] DOC: rcParams remove unneeded "... parameters" from all section titles --- lib/matplotlib/rcsetup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index b46edba9b2f0..8f1dbde78bfb 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3508,7 +3508,7 @@ class _Subsection: "cause minor artifacts, though. A value of 20000 is probably a " "good starting point." ), - _Subsection("Mac OSX backend parameters"), + _Subsection("Mac OSX backend"), _Param( "macosx.window_mode", default="system", @@ -3517,7 +3517,7 @@ class _Subsection: description="How to open new figures: 'system', 'tab', or 'window'; " "'system' uses the macOS system preferences." ), - _Subsection("Tk backend parameters"), + _Subsection("Tk backend"), _Param( "tk.window_focus", default=False, @@ -3525,7 +3525,7 @@ class _Subsection: validator=validate_bool, description="Whether TkAgg should keep shell focus after opening a figure." ), - _Subsection("PS backend parameters"), + _Subsection("PS backend"), _Param( "ps.papersize", default="letter", @@ -3572,7 +3572,7 @@ class _Subsection: validator=validate_fonttype, description="Output Type 3 (Type3) or Type 42 (TrueType)" ), - _Subsection("PDF backend parameters"), + _Subsection("PDF backend"), _Param( "pdf.compression", default=6, @@ -3603,7 +3603,7 @@ class _Subsection: type=bool, validator=validate_bool, ), - _Subsection("SVG backend parameters"), + _Subsection("SVG backend"), _Param( "svg.image_inline", default=True, @@ -3637,7 +3637,7 @@ class _Subsection: description="If not None, use this string as the value for the ``id`` " "attribute in the top ```` tag." ), - _Subsection("PGF parameters"), + _Subsection("PGF backend"), _Param( "pgf.rcfonts", default=True, @@ -3659,7 +3659,7 @@ class _Subsection: validator=["xelatex", "lualatex", "pdflatex"], description="The TeX engine to use for PGF output." ), - _Subsection("Webagg backend parameters"), + _Subsection("Webagg backend"), _Param( "webagg.port", default=8988, From f3103a8780d437bf9d11cc8801f4045e615e1484 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:52:52 +0200 Subject: [PATCH 105/210] DOC: rcParams move "pcolor.shading" and "pcolormesh.snap" from section "Lines" to "Images" We could also have a dedicated section, but I'm not clear how to call that. --- lib/matplotlib/rcsetup.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 8f1dbde78bfb..5960a1ff3379 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -2814,23 +2814,6 @@ class _Subsection: validator=validate_fillstyle, description="The marker fill style." ), - _Param( - "pcolor.shading", - default="auto", - type=Literal["auto", "flat", "nearest", "gouraud"], - validator=["auto", "flat", "nearest", "gouraud"], - description="The default shading mode for `~.Axes.pcolor` and " - "`~.Axes.pcolormesh`." - ), - _Param( - "pcolormesh.snap", - default=True, - type=bool, - validator=validate_bool, - description="Whether to snap the mesh to pixel boundaries. This is provided " - "solely to allow old test images to remain unchanged. Set to False " - "to obtain the previous behavior." - ), _Section("Patches"), _Param( "patch.linewidth", @@ -3234,6 +3217,23 @@ class _Subsection: "single composite image before saving a figure as a vector " "graphics file, such as a PDF." ), + _Param( + "pcolor.shading", + default="auto", + type=Literal["auto", "flat", "nearest", "gouraud"], + validator=["auto", "flat", "nearest", "gouraud"], + description="The default shading mode for `~.Axes.pcolor` and " + "`~.Axes.pcolormesh`." + ), + _Param( + "pcolormesh.snap", + default=True, + type=bool, + validator=validate_bool, + description="Whether to snap the mesh to pixel boundaries. This is provided " + "solely to allow old test images to remain unchanged. Set to False " + "to obtain the previous behavior." + ), _Section( "Contour plots", description="Default settings for `~.Axes.contour` / `~.Axes.contourf`. " From 77cf397e9f918951eceff5ef88b83b035da1d650 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:56:41 +0200 Subject: [PATCH 106/210] DOC: rcParams remove subsection Docstring parameters --- lib/matplotlib/rcsetup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 5960a1ff3379..d9d3423777f9 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3689,7 +3689,6 @@ class _Subsection: validator=validate_bool, description="When True, open the web browser to the plot that is shown." ), - _Subsection("Docstring parameters"), _Section( "Interactive keymaps", description="Default key mappings for interactive navigation. See " From 8449128ead032e3967e4b51433806adb06b7188c Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Fri, 11 Sep 2026 22:22:52 -0400 Subject: [PATCH 107/210] Fix Agg bug of internally blending fill/hatch/stroke of paths --- src/_backend_agg.cpp | 2 ++ src/_backend_agg.h | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index aba284719df0..2ab4eb73c4a5 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -11,6 +11,7 @@ RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi) dpi(dpi), NUMBYTES((size_t)width * (size_t)height * 4), pixBuffer(nullptr), + otherPixBuffer(nullptr), renderingBuffer(), alphaBuffer(nullptr), alphaMaskRenderingBuffer(), @@ -58,6 +59,7 @@ RendererAgg::~RendererAgg() delete[] hatchBuffer; delete[] alphaBuffer; delete[] pixBuffer; + delete[] otherPixBuffer; } void RendererAgg::create_alpha_buffers() diff --git a/src/_backend_agg.h b/src/_backend_agg.h index 99ccac555347..3130ba289701 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -209,7 +209,7 @@ class RendererAgg double dpi; size_t NUMBYTES; // the number of bytes in buffer - agg::int8u *pixBuffer; + agg::int8u *pixBuffer, *otherPixBuffer; agg::rendering_buffer renderingBuffer; agg::int8u *alphaBuffer; @@ -303,6 +303,20 @@ template inline void RendererAgg::_draw_path(path_t &path, bool has_clippath, const std::optional &face, GCAgg &gc) { + // Render first in an isolated buffer if the path blend mode is other than "normal" + // and if more than one of fill/hatch/stroke is active to avoid internal blending + bool isolate = (gc.comp_op != agg::comp_op_src_over) && + ((bool(face) + gc.has_hatchpath() + (gc.linewidth != 0)) > 1); + if (isolate) { + if (!otherPixBuffer) { + otherPixBuffer = new agg::int8u[NUMBYTES]; + } + memset(otherPixBuffer, 0, NUMBYTES); + renderingBuffer.attach(otherPixBuffer, width, height, width * 4); + } else { + pixFmt.comp_op(gc.comp_op); + } + theRasterizer.filling_rule(gc.filling_rule); // Render face @@ -440,6 +454,19 @@ RendererAgg::_draw_path(path_t &path, bool has_clippath, const std::optional @@ -451,8 +478,6 @@ RendererAgg::draw_path(GCAgg &gc, PathIterator &path, agg::trans_affine &trans, face = color; } - pixFmt.comp_op(gc.comp_op); - theRasterizer.reset_clipping(); rendererBase.reset_clipping(true); set_clipbox(gc.cliprect, theRasterizer); @@ -478,8 +503,6 @@ RendererAgg::draw_path(GCAgg &gc, PathIterator &path, agg::trans_affine &trans, curve, gc.sketch.scale, gc.sketch.length, gc.sketch.randomness}; _draw_path(sketch, has_clippath, face, gc); - - pixFmt.comp_op(agg::comp_op_src_over); } template @@ -1057,7 +1080,6 @@ inline void RendererAgg::draw_path_collection(GCAgg &gc, AntialiasedArray &antialiaseds, ColorArray &hatchcolors) { - pixFmt.comp_op(gc.comp_op); _draw_path_collection_generic(gc, master_transform, gc.cliprect, @@ -1075,7 +1097,6 @@ inline void RendererAgg::draw_path_collection(GCAgg &gc, true, true, hatchcolors); - pixFmt.comp_op(agg::comp_op_src_over); } template @@ -1171,7 +1192,6 @@ inline void RendererAgg::draw_quad_mesh(GCAgg &gc, DashesVector linestyles; ColorArray hatchcolors = py::array_t().reshape({0, 4}).unchecked(); - pixFmt.comp_op(gc.comp_op); _draw_path_collection_generic(gc, master_transform, gc.cliprect, @@ -1189,7 +1209,6 @@ inline void RendererAgg::draw_quad_mesh(GCAgg &gc, true, // check_snap false, hatchcolors); - pixFmt.comp_op(agg::comp_op_src_over); } template From e4d8a5ccff3e8fa1422364d5f92beccabe3a0e12 Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Fri, 11 Sep 2026 22:23:03 -0400 Subject: [PATCH 108/210] Fix Cairo bug of internally blending fill/hatch/stroke of paths --- lib/matplotlib/backends/backend_cairo.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index e0627418b107..9888ff578735 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -135,6 +135,18 @@ def _fill_and_stroke(ctx, fill_c, alpha, alpha_overrides): def draw_path(self, gc, path, transform, rgbFace=None): # docstring inherited + + # Use an isolated blend group if the path blend mode is other than "normal" and + # if more than one of fill/hatch/stroke is active to avoid internal blending + hatch_path = gc.get_hatch_path() + isolate = ((blend_mode := gc.get_blend_mode()) != "normal" and + sum([rgbFace is not None, + hatch_path is not None, + gc.get_linewidth() > 0]) > 1) + if isolate: + self.open_blend_group(blend_mode) + gc.set_blend_mode("normal") + ctx = gc.ctx # Clip the path to the actual rendering extents if it isn't filled. clip = (ctx.clip_extents() @@ -149,7 +161,6 @@ def draw_path(self, gc, path, transform, rgbFace=None): _set_rgba(ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha()) ctx.fill_preserve() ctx.restore() - hatch_path = gc.get_hatch_path() if hatch_path: dpi = int(self.dpi) hatch_surface = ctx.get_target().create_similar( @@ -170,6 +181,9 @@ def draw_path(self, gc, path, transform, rgbFace=None): ctx.restore() ctx.stroke() + if isolate: + self.close_blend_group() + def draw_markers(self, gc, marker_path, marker_trans, path, transform, rgbFace=None): # docstring inherited From 9f78df3eb2b590dad780587c1b8332d5dd583614 Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Fri, 11 Sep 2026 22:24:31 -0400 Subject: [PATCH 109/210] Fix PGF bugs related to hatch styles and hatch priority --- lib/matplotlib/backends/backend_pgf.py | 37 ++++++++++++------ .../test_backend_pgf/pgf_rcupdate2.pdf | Bin 129368 -> 129383 bytes .../fill_rules_pgf.pdf | Bin 8046 -> 8095 bytes 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 7ea6eb09b557..dd70d1b1f67d 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -437,15 +437,17 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, def draw_path(self, gc, path, transform, rgbFace=None): # docstring inherited - _writeln(self.fh, r"\begin{pgfscope}") - # draw the path - self._print_pgf_blend(gc) - self._print_pgf_clip(gc) - self._print_pgf_path_styles(gc, rgbFace) - self._print_pgf_path(gc, path, transform, rgbFace) - self._pgf_path_draw(stroke=gc.get_linewidth() != 0.0, - fill=rgbFace is not None) - _writeln(self.fh, r"\end{pgfscope}") + + # draw any fill, and/or draw any stroke if no hatches + if rgbFace is not None or (gc.get_linewidth() != 0.0 and not gc.get_hatch()): + _writeln(self.fh, r"\begin{pgfscope}") + self._print_pgf_blend(gc) + self._print_pgf_clip(gc) + self._print_pgf_path_styles(gc, rgbFace) + self._print_pgf_path(gc, path, transform, rgbFace) + self._pgf_path_draw(stroke=gc.get_linewidth() != 0.0 and not gc.get_hatch(), + fill=rgbFace is not None) + _writeln(self.fh, r"\end{pgfscope}") # if present, draw pattern on top if gc.get_hatch(): @@ -473,6 +475,9 @@ def draw_path(self, gc, path, transform, rgbFace=None): % hatch_rgba[:3]) _writeln(self.fh, r"\pgfsetstrokecolor{currenthatch}") _writeln(self.fh, r"\pgfsetstrokeopacity{%f}" % hatch_rgba[3]) + _writeln(self.fh, r"\pgfsetdash{}{0pt}") + _writeln(self.fh, r"\pgfsetfillcolor{currenthatch}") + _writeln(self.fh, r"\pgfsetfillopacity{%f}" % hatch_rgba[3]) _writeln(self.fh, r"\pgfpathrectangle" @@ -480,7 +485,7 @@ def draw_path(self, gc, path, transform, rgbFace=None): _writeln(self.fh, r"\pgfusepath{clip}") scale = mpl.transforms.Affine2D().scale(self.dpi) self._print_pgf_path(None, gc.get_hatch_path(), scale) - self._pgf_path_draw(stroke=True) + self._pgf_path_draw(stroke=True, fill=True) _writeln(self.fh, r"\end{pgfscope}") _writeln(self.fh, r"}") # repeat pattern, filling the bounding rect of the path @@ -501,6 +506,16 @@ def draw_path(self, gc, path, transform, rgbFace=None): _writeln(self.fh, r"\end{pgfscope}") + # draw any stroke on top of hatches + if (gc.get_linewidth() != 0.0): + _writeln(self.fh, r"\begin{pgfscope}") + self._print_pgf_blend(gc) + self._print_pgf_clip(gc) + self._print_pgf_path_styles(gc, rgbFace) + self._print_pgf_path(gc, path, transform, rgbFace) + self._pgf_path_draw(stroke=True, fill=False) + _writeln(self.fh, r"\end{pgfscope}") + def _print_pgf_blend(self, gc): if (blend_mode := gc.get_blend_mode()) not in _BlendModePDFSpec: _log.warning(f"The '{blend_mode}' blend mode is not supported by the " @@ -648,7 +663,7 @@ def _print_pgf_path(self, gc, path, transform, rgbFace=None): _writeln(self.fh, f"\\pgfmathsetseed{{{int(randomness)}}}") _writeln(self.fh, r"\pgfdecoratecurrentpath{random steps}") - def _pgf_path_draw(self, stroke=True, fill=False): + def _pgf_path_draw(self, *, stroke, fill): actions = [] if stroke: actions.append("stroke") diff --git a/lib/matplotlib/tests/baseline_images/test_backend_pgf/pgf_rcupdate2.pdf b/lib/matplotlib/tests/baseline_images/test_backend_pgf/pgf_rcupdate2.pdf index 6d2dc07a9fe25d98242fff59e72bd754588d6a20..1ed84f6dd82cc19c4e07917d5e8578ece83d9ddd 100644 GIT binary patch delta 4462 zcmb`JRa6uVw}u&DhVIUxyM`QKK0siQmTt+RTT+Q3hm;Tj>5x)T22nz~C5BX5x*I`S zILB|D^{;bxZqB}V*1OlU*L%HZf8lNa!b{`AhDc;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8-(LuP&Dq2| zjo*wOJLtW&U#XHoKz<+y-P>>-y6x1V|4Y+|tcG1kNZESZnVu!c`65=<8`tDw!MYg8eYz0%2Wu2}E}E?L{4y5st{Cd9((@UG_aco~1kIIz5XNJ!Zg7Jsq(VYfNZAv$X>GKjfKN zpgR5erFF-<=)<~-tg?;v@v0eCeQ5McHrv^Bf%6}bH$qt#29<{?!J)D$if|Z04hGYP zA{2FGWOa1qbfHjPO#$`)%TmB}3Q_^o^obpB;10JBvmX`ZulnT|?7v!M_ef3h@S(wj9KCDRv z-Bc%`2>c%uBY~vR)VXd~QTM?;`;EbXRj)YZ#&ARC`40R0+Q;)==u`DWw4kb%eXHxw zNeRP!`|ydZKg%Z;43WAUvtiw`WlOlArLaXMYj@oDibLIv%a5lEvOP;ZZiw6=(Z$ro lwF64KQGW;}wVSVNP;j7|lTX220*H+YszNOyqGPN}{XgyoN}>P& diff --git a/lib/matplotlib/tests/baseline_images/test_backends_rendering/fill_rules_pgf.pdf b/lib/matplotlib/tests/baseline_images/test_backends_rendering/fill_rules_pgf.pdf index d7ad8aa5b72b4b6e5015165a3146f369104c051a..0add49023bbc99c914c36068e84af45c9b2d6758 100644 GIT binary patch delta 2481 zcmajfXEYlM9|rKos#3F26tOAoCE^+}QfkDg8kg3*_Nduf327R=w5cMvvG*udtBO{w zkg83rYmcBKQ4+Bg<$dq%Iq$jO-t#->`Skzre0lzKSmBKnHH@l?Dh$RE79Q&D9>js1 zqdA+0EU5Dm4(<-k#t4xZTtK7Tl3!ACotU94P@pNTWR%S!x{th>;+R@$&)FL25~Wk0EpY?CHbsKjBlOfM=OO@_+Ay?Rnv(FQ%-)&bL@3J>7vVM-3A&K zE*#*(B>3I0YA%Zb-c;Sl z&dIzm&C)B3VRB~5(}3$-86Y6RE&$#E;=ZSX8wNHq;mSPg}sOqgR87N zY`c8Mp8YTjF9J})7(2#x+pgXr;@&#MVdVK1Il8dCr>p%f)!0-RUQn~N>sp7t{zW7B zYCrjICi(2JE3|ui`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Xixz4=@|=)P4~IbHt&*OOf*p&pBe^hhnBzx(2|yY@P4l@aBiE)SMe~VLs_W!~?1ky2P{tD@ z-w@!E_h@f8_^Ne@XJ@BL?M)2fI%{>uddsAHpJ|cJ2tQ`tj_O>9f~kaC>G~2lgx~TX zW;WFrPT4fOr`-)OjOd_LqtcwaOX2zA+#X~C-X6T~#_K)h3Nz&lP?O#`)jY&YJtgw- zAkOPVrB;S5d-vjcs^2EHYlcaWcFV&P0TI@7A8?vXHfF+MEv|udrY`f9*TBm8k3EL8 z_5DE*b15s2Qd{+4L*a0J2i(OS=4G)aj1*te!C z?lhZ-yHgezd&Jw+aRAO%FXf-y&>1BknFH0F)>jkf`4-5&g@7OUZ0A7%86koYEk$`1 zXGay7tgI^x>Zs)G1apDP$|^ZQUC~e|%n^o$tN))w#*`q!;(vw&dDp=bBgCdNWSyxC zeo4b&uzl}Vh`Vk-C_B5*2x0D}WzB1;&-P|E#z_@o5c1eeK_};pV_g_7ID!0Y9dxR? a`*$=PPmjq6`$K?92`0}3f#@O;O#cBYqp1S` From 123f40913d088a0899fe75dac06ca49d66939e7b Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Fri, 11 Sep 2026 22:24:42 -0400 Subject: [PATCH 110/210] Fix PGF bug of internally blending fill/hatch/stroke of paths --- lib/matplotlib/backends/backend_pgf.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index dd70d1b1f67d..cbacc088be8d 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -438,6 +438,16 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, def draw_path(self, gc, path, transform, rgbFace=None): # docstring inherited + # Use an isolated blend group if the path blend mode is other than "normal" and + # if more than one of fill/hatch/stroke is active to avoid internal blending + isolate = ((blend_mode := gc.get_blend_mode()) != "normal" and + sum([rgbFace is not None, + gc.get_hatch() is not None, + gc.get_linewidth() > 0]) > 1) + if isolate: + self.open_blend_group(blend_mode) + gc.set_blend_mode("normal") + # draw any fill, and/or draw any stroke if no hatches if rgbFace is not None or (gc.get_linewidth() != 0.0 and not gc.get_hatch()): _writeln(self.fh, r"\begin{pgfscope}") @@ -516,6 +526,9 @@ def draw_path(self, gc, path, transform, rgbFace=None): self._pgf_path_draw(stroke=True, fill=False) _writeln(self.fh, r"\end{pgfscope}") + if isolate: + self.close_blend_group() + def _print_pgf_blend(self, gc): if (blend_mode := gc.get_blend_mode()) not in _BlendModePDFSpec: _log.warning(f"The '{blend_mode}' blend mode is not supported by the " From ad560b88ea6c9dbd436c251f9eca4831fe69a16f Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Fri, 11 Sep 2026 22:25:02 -0400 Subject: [PATCH 111/210] Add figure tests to check for internal blending of fill/hatch/stroke --- .../patch_blending.pdf | Bin 0 -> 22069 bytes .../patch_blending.png | Bin 0 -> 29170 bytes .../patch_blending.svg | 1914 +++++++++++++++++ .../patch_blending_cairo.png | Bin 0 -> 31962 bytes .../patch_blending_pgf.pdf | Bin 0 -> 48028 bytes .../tests/test_backends_rendering.py | 43 + 6 files changed, 1957 insertions(+) create mode 100644 lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.pdf create mode 100644 lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.png create mode 100644 lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.svg create mode 100644 lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending_cairo.png create mode 100644 lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending_pgf.pdf diff --git a/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.pdf b/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.pdf new file mode 100644 index 0000000000000000000000000000000000000000..851f7c3ffacb04f4de2e6749ae8aa2d3b21f586e GIT binary patch literal 22069 zcmd_SbzD@<`!}wXlyplhu(ZGeOZSpXE}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vv;gmgRpysLq|FYq;1NsyqviwmY_IN1f^ ie9Z-P+%p{S+i>@=a`QOu5`={y5J^G~4i#Nh!v7DWZ65>x literal 0 HcmV?d00001 diff --git a/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.png b/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.png new file mode 100644 index 0000000000000000000000000000000000000000..416b66d04e47606132d04ecd8eab5cd6d30efdb6 GIT binary patch literal 29170 zcmY(q1y~zVvj9qQ_fWh@(NLUXh2rj(;9e;1?oMzCE(J=F0Kwh8xLYY&iWJx4kN*F? z@7?$9$?lxpoHH|L^h~nRYAUignB3LZ^|PY`4?7n(J14t^rN?_t9-x&OFFy~Tpee5z z8;!M_o0F>$2Z#OtJBHoS#fn2)J<;W5UJNHWT~`DIJkx)lSEV0IJ|iGFE6GcVYk934 zru|e*F(r*W2`{D!|1FPWj>b?If~_P}T8&PJE|dtyC!m%`At-ulZf-#czitNynk zDK6FiFZ}N&XEir_MYrmCz%rjl0i9pvp?mfRC)M9P6{j8#qM4J`Gl5-hd)MDQ`8_(j zzW)76@#g!a4QLP3umI@BKmyuhC2H&KCiDOYzr|5W_KnSvoZ}IT9pAGM@d?-We-GZr zhWaJ2jXC|_5m>D+BW%D=q%9HO*A!!mf1T%L!andFHw}>eci!--{w+*HOJxu#7!eDY z_|`GiC$t}&RkiAUy8xqFr;Cv~v57ZiP%S0mdl@iZ3zM?{+5D{s1h0GFkddvgG%lo= zvasyr^DFgkNZu{HN@HCc`}xc8KeS5VVrTNG#6IcR@jk$kZ~~4_WJG$*3?QK@?M_zP z-}eX7KvwhldLplL@icvdfD1*J&I_XhC9r|2zjq6Jo%EYL`oy5B8IQB)tK$s<`(9yTgjC{%`$^XgCofNH_F4VcR^#f%#grK${F$jWbFeH07Yd`=bR={SX1P{S z_VE{-ua=AUA$t2Z^}&2>tP&j`vFDq}u9Guxaj6$OTgR@~C?`ua`;2ZF{PyIY=1`@g z-~6Cozy2$lefZZTZ8J`qu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46r^pmmrTV>?lUcjJkvWUdx5%FV_&ZP{@ek{nY}W4s#ig>|ff}8geg}_K%r|QJ zW0zfC+|`%P?#h9gnucwGZT#?Nkcb|S2T_@kpOmk@yS+s|gH;XK*(&Asu8eNPW$bVn zml&#G^;{bn!+LgS(kl8Ehk`Eg6#@lP6bA#=?{2?% z*L{?h^jZ=O!)^rh;Vy35QTXKLp$|G!lF=~8o z-TylH<1t50hpggb2M$>j&h2DcFY5vGchFa}22;o@jT1LtrNtg9EeTefp9~aX@>l(k}rc&TpPrFGn!)C%%b5$QXR%nx~-B{ zAYm2=g7guF)DTt&u*8ylVT1y)HIp;+Sg}Pu!o);>R7ff#Pye>9?88LiZ!OAc64>og zdytDiVXO&a3rDYtiJ3WCm{4any?|`$npFaQ%hBQ!1Z%eVPw@-5g zndf6eHZ6iobiDY_Gk(><;!Z+|XhO;VeQNq$k&8{0?Di&gaQ?gHr=#^u6Rlwp`F{Y0 Cjs}MS literal 0 HcmV?d00001 diff --git a/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.svg b/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.svg new file mode 100644 index 000000000000..b9edc22ef410 --- /dev/null +++ b/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending.svg @@ -0,0 +1,1914 @@ + + + + + + + + 2026-09-13T12:12:05.142171 + image/svg+xml + + + Matplotlib v3.12.0.dev603+gb47359a4b, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending_cairo.png b/lib/matplotlib/tests/baseline_images/test_backends_rendering/patch_blending_cairo.png new file mode 100644 index 0000000000000000000000000000000000000000..ad80c7b037a58a63ed24ed3faa27021e7ad76af3 GIT binary patch literal 31962 zcmY(q1z1#H^e&7b4T`|fsUk6ebV+we#|+)wB@NOrq~L%8(j@~7E#0AX4InAq-Te)} z``!D$_u+8%W@et*`(10Vc-LV?tEtH0<51wBprGI@$V+RWprFwq=fAN~k@u{9LS^KD zVWuP}jq>>PligC3jDq5ypdc-wo!ir|zN%1Zmi)j*GOYSEmi*2- zlb+tb^%Lg7zww<|cwRkNR@!Y0-_TV5GIc#@wf?wmugav`IyP;g zCfzU{8-IiMj$VN~tyhh5BE`LWx42f!-;JaF(Qpj#bp7lB7+(8IG2v;uvk{j9zMUJN>Xn&Hk`@#Gek?;8f zRvESvJ8&Ymx(z8`^Qi4yn-AEX`#BNt_tw$#mFErJy$1;e8s%>(%&kJ?nnrX~b@JNR}&7 zNRNjsXWNHYVGl`V`#0@{x|E#Z3%~jb1L3m=4+Kci>kH-9DW&r(;{mldp6ePGmBh)c zi1M!wc4A!*dPVoKw`$G!YpCeKrG}-qq3#z->~rsbxwNStK9r840pF@9Py4m#c<~tG z4}0*=wo`0{tv^JYKIlf=-(nJAQwwq}AFql%KHy(eycRL^3{(vJRmq_b%GQ!UoMAtQB?>M5gD&vG<1g6_tsAzusv- z&Tf-?K$hwY9|Y}vIpemu-$~KMH?M_d=NnXG6*qqlrNbMI?P^Nzmre}KKHq8&2_U$GszPyHJ;Y9^3WS+D(Y{nX1(pPuO@xEa(#HPCWp6D6G zeP~LNvi{NUeM3#ae6C>g1mHCDUeWz>j(;yf<*)HUW!s-mK?%nX+Z4CfCHsfm^Gj9@ zZM{B0if4hBkb6DNOLxZwF~V`gMe+RoE%}9YxY;Gtktiyy0PQ*oQYSvaAGrQkUoTBL;$^Uc#1Czp2h6_L`}dKb54fx6_!h zt_XVAjKz>j6|}z=HS`QnoC)}bHq(pxnhxzZwK9lo8^;_0dQR~d#AOFii=8$b+)THC~f26Eb9K_*;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 2026 01:15:23 -0400 Subject: [PATCH 112/210] Fix bug with an isolated blend group in Cairo using the group blend mode knockout or clear --- lib/matplotlib/backends/backend_cairo.py | 21 +++++++++++++++--- .../blend_groups_agg.png | Bin 11107 -> 12572 bytes .../blend_groups_cairo.png | Bin 11132 -> 12858 bytes .../tests/test_backends_rendering.py | 18 ++++++++++++--- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index e0627418b107..6fe79bc71843 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -380,10 +380,25 @@ def close_blend_group(self): ctx.save() self.gc.set_blend_mode(group_state.blend_mode) ctx.set_source(group) - if group_state.alpha != 1: - ctx.paint_with_alpha(group_state.alpha) + + # For these two Porter-Duff compositing operators, we need to mask out fully + # transparent pixels, otherwise those pixels will override the backdrop + if group_state.blend_mode in {'knockout', 'clear'}: + # Extract the 8-bit alpha channel + mask_surface = ctx.get_target().create_similar_image( + cairo.FORMAT_A8, self.width, self.height) + mask_ctx = cairo.Context(mask_surface) + mask_ctx.set_source(group) + mask_ctx.paint() + mask_surface.flush() + + # Pixels that are not fully transparent are painted with the group alpha + mask_buf = np.asarray(mask_surface.get_data()) + mask_buf[mask_buf > 0] = 255 * group_state.alpha + 0.5 # round to int + ctx.mask_surface(mask_surface) else: - ctx.paint() + ctx.paint_with_alpha(group_state.alpha) + ctx.restore() diff --git a/lib/matplotlib/tests/baseline_images/test_backends_rendering/blend_groups_agg.png b/lib/matplotlib/tests/baseline_images/test_backends_rendering/blend_groups_agg.png index 4cbd4b6f70955b52f7176d25ef891b24918d068b..a86c90d44147fb9c4f67da733faf17e778dda883 100644 GIT binary patch literal 12572 zcmaibXH-*L*KP_Sw9tE30i_3}_aY!oL3&N-9U@(7qLic31gR>Z6hV+CNDl!NrAhBC zfPnPSo5GEr_x;BGamROm?7cH~)|~5E&zfz`j65;Cs|}-IrvLx|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@W-(R?&D5nH%t>552*y-70CX{*rbM_m`FfPsg+sQhzfS_`%yOhFsk$Iq^(PZ z;4Sr4ZiE-BFv8U618>PRtCmE4S^(@#AOEumK8Fat=LMBs_6p>h<*r9pi)R0>sFN)k zi>^u+Sf?>_Y5B((zakf6g02%f%-o75F@N%WUa>V)8DGcmtXwM#LdJ69fX0)Og?>{Y z7Kab(2dH>5nsaWucmUP)!7CuY{~OztsPl9mBwJoaX`DX}2rqad$Q z5!2L|7hMqVE4=2DB%l(_o5sA=HIEtI*U|OZV|iNL-4^O^nUrR~u{Xmam3B+DKn6r!mdgYxdqlrRp8@ASh4B8$j%J4fBv zY-0YGAHM12gP$HYdTpJR3Wgg>c0n5m6h9q#XVKwtm%89Zn5gu@oUxiGz-pTPNv)mk zm?CiQb)o~5w`wGLZ%~;in191X=E%sG=AylE+v(^HnEu#UGdLT8C~*yI5$s(psY4&H zZLgzk!gNk#kP@RSKYsIxabFFkO^Ch&Rr-U?~Gl}UTn>p!!{lcq@w<*?l z`iI8bNlD{%;w(&U*UFzQo%ujj1>T6Ud{GOOL0A=KSmBl=Z?#d^TQ=jQ-*9yd$!#mk zyQ`=Em6!|Cg~mwuR-dU7e0a3rpU7?F0GIBx&z1?9cYZcjeCC*;oqA!(7cg(g_2^p9qz1sn!3_{~ z@n@dI@z^`nh3KCd-gxFeDERl{E`2&i#z^}55Bpm@fV^0yux_;YRvi2}km=cteu&VL zeh%OVWj{pRG&8`a1TDAcVZz|cKS$cp`-sg;0@TA0KPgjq7W)4H D%u=BA diff --git a/lib/matplotlib/tests/test_backends_rendering.py b/lib/matplotlib/tests/test_backends_rendering.py index 72de3238706c..8802431a38b2 100644 --- a/lib/matplotlib/tests/test_backends_rendering.py +++ b/lib/matplotlib/tests/test_backends_rendering.py @@ -93,7 +93,7 @@ def draw(self, renderer): renderer.close_blend_group() -def plot_blend_group_types(rasterize=False): +def plot_blend_group_types(rasterize=False, porterduff=False): # Rows: top row is non-isolated, bottom row is isolated # Columns: left column is non-knockout, right column is knockout fig, axs = plt.subplots(2, 2, figsize=(3, 3), dpi=80, layout='constrained') @@ -129,6 +129,18 @@ def plot_blend_group_types(rasterize=False): gray = Circle((0, 0), 0.1, fc='gray', zorder=0) axs[i, j].add_artist(gray) + # For backends that support the Porter-Duff compositing operators, additionally + # test 'knockout' and 'clear' as the blend mode for an isolated group + if porterduff: + for x, group_blend_mode, group_alpha in [(-0.6, 'knockout', 1), + (-0.2, 'knockout', 0.6), + (0.2, 'clear', 0.6), + (0.6, 'clear', 1)]: + circle = Circle((x, -0.8), 0.15, fc='k', alpha=0.75) + group = ArtistGroup([circle], group_blend_mode=group_blend_mode, + group_alpha=group_alpha) + axs[1, 0].add_artist(group) + @image_comparison(['blend_modes_agg.png'], style='mpl20') def test_blend_modes_agg(): @@ -184,7 +196,7 @@ def test_blend_groups_agg(): # The top-right panel (knockout but not isolated) is not supported, so will be # rendered like the top-left panel (neither knockout nor isolated) - plot_blend_group_types() + plot_blend_group_types(porterduff=True) @pytest.mark.backend('cairo') @@ -193,7 +205,7 @@ def test_blend_groups_cairo(): # The top-right panel (knockout but not isolated) is not supported, so will be # rendered like the top-left panel (neither knockout nor isolated) - plot_blend_group_types() + plot_blend_group_types(porterduff=True) @image_comparison(['blend_groups_svg.svg'], style='mpl20') From d6635c1264d24d01a0ff8437826d80ac260d9e3e Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 8 Oct 2026 15:43:11 -0400 Subject: [PATCH 113/210] clean up date rcparam header --- lib/matplotlib/rcsetup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 3f5b01e0bae4..836742524aa4 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -2501,10 +2501,8 @@ class _Subsection: _Section( "Dates", description="Default properties for date tick labels. These are used by the " - "`.AutoDateFormatter` when the appropriate time unit is detected." - "See " - "https://matplotlib.org/stable/api/dates_api.html#date-formatters " - "for more information." + "`.AutoDateFormatter` when the appropriate time unit is detected. " + "See :ref:`date-format` for more information." ), _Param( "date.autoformatter.year", "%Y", str, validate_string, From 41e57b5c09867677aac1b962cdb78dc0d363f972 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 19:25:18 +0000 Subject: [PATCH 114/210] Bump reviewdog/action-eslint from 1.36.0 to 1.36.1 in the actions group Bumps the actions group with 1 update: [reviewdog/action-eslint](https://github.com/reviewdog/action-eslint). Updates `reviewdog/action-eslint` from 1.36.0 to 1.36.1 - [Release notes](https://github.com/reviewdog/action-eslint/releases) - [Commits](https://github.com/reviewdog/action-eslint/compare/b6303df522851d0e9abaea654da0222037d97e75...3ee2a450da17e060b9dfa4bffd53976906c6b2b0) --- updated-dependencies: - dependency-name: reviewdog/action-eslint dependency-version: 1.36.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/linting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 634c87feaeec..4c45d9012208 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -128,7 +128,7 @@ jobs: persist-credentials: false - name: eslint - uses: reviewdog/action-eslint@b6303df522851d0e9abaea654da0222037d97e75 # v1.36.0 + uses: reviewdog/action-eslint@3ee2a450da17e060b9dfa4bffd53976906c6b2b0 # v1.36.1 with: filter_mode: nofilter github_token: ${{ secrets.GITHUB_TOKEN }} From ecdb08e25dfa7f1eb781c8ce2fe24ad5adc645c5 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 10 Oct 2026 05:25:30 +0200 Subject: [PATCH 115/210] FIX: Correctly handle multiple paragraphs in rcParams doc generation --- doc/sphinxext/rcparams.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/sphinxext/rcparams.py b/doc/sphinxext/rcparams.py index f2f56de3b39a..17535b801675 100644 --- a/doc/sphinxext/rcparams.py +++ b/doc/sphinxext/rcparams.py @@ -1,3 +1,4 @@ +import textwrap import typing from docutils.parsers.rst import Directive @@ -52,7 +53,8 @@ def run(self): f'.. _rcparam_{elem.name.replace(".", "_")}:', '', f'{elem.name} : {typestr} = ``{elem.default!r}``', - f' {elem.description if elem.description else "*no description*"}' + *textwrap.indent( + elem.description or '*no description*', ' ').splitlines(), '', ] self.state_machine.insert_input(lines, 'rcParams table') From cdc1110a44f4795bf9b96d878a68e27ab2f63b01 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Sat, 10 Oct 2026 17:16:41 +0000 Subject: [PATCH 116/210] DOC: Fix stale paths in the developer guide --- doc/devel/contribute.rst | 6 +++--- doc/devel/document.rst | 6 +++--- doc/devel/pr_guide.rst | 2 +- doc/devel/testing.rst | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/devel/contribute.rst b/doc/devel/contribute.rst index 83e6992cdc39..9e1ca56b889a 100644 --- a/doc/devel/contribute.rst +++ b/doc/devel/contribute.rst @@ -104,7 +104,7 @@ you can: - Write or update an :ref:`example plot ` - Write or update a comprehensive :ref:`tutorial ` -Our code is documented inline in the source code files in :file:`matplotlib/lib`. +Our code is documented inline in the source code files in :file:`lib/matplotlib`. Our website structure mirrors our folder structure, meaning that a narrative document's URL roughly corresponds to its location in our folder structure: @@ -113,8 +113,8 @@ document's URL roughly corresponds to its location in our folder structure: .. grid-item:: using the library * :file:`galleries/plot_types/` - * :file:`users/getting_started/` - * :file:`galleries/user_explain/` + * :file:`doc/users/getting_started/` + * :file:`galleries/users_explain/` * :file:`galleries/tutorials/` * :file:`galleries/examples/` * :file:`doc/api/` diff --git a/doc/devel/document.rst b/doc/devel/document.rst index 8b66bd588548..370b482c74df 100644 --- a/doc/devel/document.rst +++ b/doc/devel/document.rst @@ -13,14 +13,14 @@ some of these files are generated from inline docstrings or sphinx gallery files Don't directly edit the ``.rst`` files in :file:`doc/plot_types`, :file:`doc/gallery`, :file:`doc/tutorials`, :file:`doc/users/explain` and - :file:`doc/api` (except :file:`doc/api/api_changes/`). Sphinx_ regenerates + :file:`doc/api` (except :file:`doc/api/next_api_changes/`). Sphinx_ regenerates files in these directories when building documentation. Overview ======== Documentation is created in three ways. First, API documentation (:file:`doc/api`) is created by Sphinx_ from the docstrings of the classes in the Matplotlib library. Except -for :file:`doc/api/api_changes/`, ``.rst`` files in :file:`doc/api` are created +for :file:`doc/api/next_api_changes/`, ``.rst`` files in :file:`doc/api` are created when the documentation is built. See :ref:`writing-docstrings`. Second, our example pages, tutorials, and some of the user guide are created by @@ -397,7 +397,7 @@ Include figures and files ------------------------- Image files can directly be included in pages with the ``image::`` directive. -e.g., :file:`tutorials/intermediate/constrainedlayout_guide.py` displays +e.g., :file:`galleries/users_explain/axes/constrainedlayout_guide.py` displays a couple of static images:: # .. image:: /_static/constrained_layout_1b.png diff --git a/doc/devel/pr_guide.rst b/doc/devel/pr_guide.rst index 1fe5a1fae82d..14aeefb9ef5b 100644 --- a/doc/devel/pr_guide.rst +++ b/doc/devel/pr_guide.rst @@ -249,7 +249,7 @@ Some explicit rules following from this: Ensure that all API changes are documented in a file in one of the subdirectories of :file:`doc/api/next_api_changes`, and significant new - features have an entry in :file:`doc/user/whats_new`. + features have an entry in :file:`doc/release/next_whats_new`. - If a PR already has a positive review, a core developer (e.g. the first reviewer, but not necessarily) may champion that PR for merging. In order diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index 3d2e6264a732..84969097fab9 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -213,7 +213,7 @@ tests it:: The first time this test is run, there will be no baseline image to compare against, so the test will fail. Copy the output images (in this case -:file:`result_images/test_lines/test_line_dashes.png`) to the correct +:file:`result_images/test_lines/line_dashes.png`) to the correct subdirectory of :file:`baseline_images` tree in the source directory (in this case :file:`lib/matplotlib/tests/baseline_images/test_lines`). Put this new file under source code revision control (with ``git add``). When rerunning From 53aea10513780272c74e8dac4614a03f9a361ab2 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 11 Oct 2026 11:53:31 +0200 Subject: [PATCH 117/210] DOC: Improve axis and ticks rcParams descriptions --- lib/matplotlib/rcsetup.py | 94 +++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 44 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 1cb01a2d4ffd..024ded07568e 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -2081,14 +2081,14 @@ class _Subsection: default="center", type=Literal["left", "center", "right"], validator=["left", "center", "right"], - description="alignment of the xaxis label: {left, right, center}" + description="Horizontal location of the x-axis label." ), _Param( "yaxis.labellocation", default="center", type=Literal["bottom", "center", "top"], validator=["bottom", "center", "top"], - description="alignment of the yaxis label: {bottom, top, center}" + description="Vertical location of the y-axis label." ), _Section( "Dates", @@ -2148,299 +2148,305 @@ class _Subsection: "interval_multiples." ), _Section("Ticks"), + _Subsection("X-Ticks"), _Param( "xtick.top", default=False, type=bool, validator=validate_bool, - description="draw ticks on the top side" + description="Whether to draw tick lines at the top of the Axes." ), _Param( "xtick.bottom", default=True, type=bool, validator=validate_bool, - description="draw ticks on the bottom side" + description="Whether to draw tick lines at the bottom of the Axes." ), _Param( "xtick.labeltop", default=False, type=bool, validator=validate_bool, - description="draw label on the top" + description="Whether to draw tick labels at the top of the Axes." ), _Param( "xtick.labelbottom", default=True, type=bool, validator=validate_bool, - description="draw label on the bottom" + description="Whether to draw tick labels at the bottom of the Axes." ), _Param( "xtick.major.size", default=3.5, type=float, validator=validate_float, - description="major tick size in points" + description="Length of the major tick lines in points." ), _Param( "xtick.minor.size", default=2.0, type=float, validator=validate_float, - description="minor tick size in points" + description="Length of the minor tick lines in points." ), _Param( "xtick.major.width", default=0.8, type=float, validator=validate_float, - description="major tick width in points" + description="Width of the major tick lines in points." ), _Param( "xtick.minor.width", default=0.6, type=float, validator=validate_float, - description="minor tick width in points" + description="Width of the minor tick lines in points." ), _Param( "xtick.major.pad", default=3.5, type=float, validator=validate_float, - description="distance to major tick label in points" + description="Spacing between tick line and tick label of major ticks in points." ), _Param( "xtick.minor.pad", default=3.4, type=float, validator=validate_float, - description="distance to the minor tick label in points" + description="Spacing between tick line and tick label of minor ticks in points." ), _Param( "xtick.color", default="black", type=":mpltype:`color`", validator=validate_color, - description="color of the ticks" + description="Color of the ticks lines." ), _Param( "xtick.labelcolor", default="inherit", type=':mpltype:`color` or "inherit"', validator=validate_color_or_inherit, - description="color of the tick labels or inherit from xtick.color" + description="Color of the tick labels. 'inherit' uses the line color of the " + "tick lines, see 'xtick.color'." ), _Param( "xtick.labelsize", default="medium", type=_FontSizeType, validator=validate_fontsize, - description="font size of the tick labels" + description="Font size of the tick labels." ), _Param( "xtick.direction", default="out", type=Literal["in", "out", "inout"], validator=["out", "in", "inout"], - description="direction: {in, out, inout}" + description="Direction of the tick lines." ), _Param( "xtick.minor.visible", default=False, type=bool, validator=validate_bool, - description="visibility of minor ticks on x-axis" + description="Whether to draw minor ticks on the x-axis." ), _Param( "xtick.major.top", default=True, type=bool, validator=validate_bool, - description="draw x axis top major ticks" + description="Whether to draw major ticks at the top of the Axes." ), _Param( "xtick.major.bottom", default=True, type=bool, validator=validate_bool, - description="draw x axis bottom major ticks" + description="Whether to draw major ticks at the bottom of the Axes." ), _Param( "xtick.minor.top", default=True, type=bool, validator=validate_bool, - description="draw x axis top minor ticks" + description="Whether to draw minor ticks at the top of the Axes." ), _Param( "xtick.minor.bottom", default=True, type=bool, validator=validate_bool, - description="draw x axis bottom minor ticks" + description="Whether to draw minor ticks at the bottom of the Axes." ), _Param( "xtick.minor.ndivs", default="auto", type=int | Literal["auto"], validator=_validate_minor_tick_ndivs, - description="number of minor ticks between the major ticks on x-axis" + description="Default number of minor ticks in between major ticks, used by " + "the `.AutoMinorLocator`." ), _Param( "xtick.alignment", default="center", type=Literal["center", "right", "left"], validator=["center", "right", "left"], - description="alignment of xticks" + description="Horizontal alignment of tick labels relative to the tick lines." ), + _Subsection("Y-Ticks"), _Param( "ytick.left", default=True, type=bool, validator=validate_bool, - description="draw ticks on the left side" + description="Whether to draw tick lines at the left of the Axes." ), _Param( "ytick.right", default=False, type=bool, validator=validate_bool, - description="draw ticks on the right side" + description="Whether to draw tick lines at the right of the Axes." ), _Param( "ytick.labelleft", default=True, type=bool, validator=validate_bool, - description="draw tick labels on the left side" + description="Whether to draw tick labels at the left of the Axes." ), _Param( "ytick.labelright", default=False, type=bool, validator=validate_bool, - description="draw tick labels on the right side" + description="Whether to draw tick labels at the right of the Axes." ), _Param( "ytick.major.size", default=3.5, type=float, validator=validate_float, - description="major tick size in points" + description="Length of the major tick lines in points." ), _Param( "ytick.minor.size", default=2.0, type=float, validator=validate_float, - description="minor tick size in points" + description="Length of the minor tick lines in points." ), _Param( "ytick.major.width", default=0.8, type=float, validator=validate_float, - description="major tick width in points" + description="Width of the major tick lines in points." ), _Param( "ytick.minor.width", default=0.6, type=float, validator=validate_float, - description="minor tick width in points" + description="Width of the minor tick lines in points." ), _Param( "ytick.major.pad", default=3.5, type=float, validator=validate_float, - description="distance to major tick label in points" + description="Spacing between tick line and tick label of major ticks in points." ), _Param( "ytick.minor.pad", default=3.4, type=float, validator=validate_float, - description="distance to the minor tick label in points" + description="Spacing between tick line and tick label of minor ticks in points." ), _Param( "ytick.color", default="black", type=":mpltype:`color`", validator=validate_color, - description="color of the ticks" + description="Color of the tick lines." ), _Param( "ytick.labelcolor", default="inherit", type=':mpltype:`color` or "inherit"', validator=validate_color_or_inherit, - description="color of the tick labels or inherit from ytick.color" + description="Color of the tick labels. 'inherit' uses the line color of the " + "tick lines, see 'ytick.color'." ), _Param( "ytick.labelsize", default="medium", type=_FontSizeType, validator=validate_fontsize, - description="font size of the tick labels" + description="Font size of the tick labels." ), _Param( "ytick.direction", default="out", type=Literal["in", "out", "inout"], validator=["out", "in", "inout"], - description="direction: {in, out, inout}" + description="Direction of the tick lines." ), _Param( "ytick.minor.visible", default=False, type=bool, validator=validate_bool, - description="visibility of minor ticks on y-axis" + description="Whether to draw minor ticks on the y-axis." ), _Param( "ytick.major.left", default=True, type=bool, validator=validate_bool, - description="draw y axis left major ticks" + description="Whether to draw major ticks at the left of the Axes." ), _Param( "ytick.major.right", default=True, type=bool, validator=validate_bool, - description="draw y axis right major ticks" + description="Whether to draw major ticks at the right of the Axes." ), _Param( "ytick.minor.left", default=True, type=bool, validator=validate_bool, - description="draw y axis left minor ticks" + description="Whether to draw minor ticks at the left of the Axes." ), _Param( "ytick.minor.right", default=True, type=bool, validator=validate_bool, - description="draw y axis right minor ticks" + description=" Whether to draw minor ticks at the right of the Axes." ), _Param( "ytick.minor.ndivs", default="auto", type=int | Literal["auto"], validator=_validate_minor_tick_ndivs, - description="number of minor ticks between the major ticks on y-axis" + description="Default number of minor ticks in between major ticks, used by " + "the `.AutoMinorLocator`." ), _Param( "ytick.alignment", default="center_baseline", type=Literal["center", "top", "bottom", "baseline", "center_baseline"], validator=["center", "top", "bottom", "baseline", "center_baseline"], - description="alignment of yticks" + description="Vertical alignment of tick labels relative to the tick lines." ), _Section("Grid"), _Param( From beb341ecc2a4e37512c72b9764c8ccc72a7f677b Mon Sep 17 00:00:00 2001 From: Gabriel Luca Date: Sun, 27 Sep 2026 17:56:56 +0100 Subject: [PATCH 118/210] FIX: Raise for single row/column grids with nearest shading Explicitly providing a single row or single column grid for pcolor(mesh) with nearest shading, silently produces no plot. This happens because nearest shading interprets the X and Y coordinates as cell centers and then calculates, from neighboring centers, new X and Y coordinates for the cell corners. When a coordinate array contains only one center, its corresponding cell size cannot be determined from neighboring centers. This commit fixes the behavior of silently producing no plot by raising an error for such grids and recommending that users supply cell corners instead. --- lib/matplotlib/axes/_axes.py | 44 +++++++++++++++++-------------- lib/matplotlib/tests/test_axes.py | 12 +++++++++ 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 276d7b61b852..0bfddc2954e7 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6535,6 +6535,15 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs): ' X (%d) and/or Y (%d); see help(%s)' % ( C.shape, Nx, Ny, funcname)) if shading == 'nearest': + if Nx == 1 or Ny == 1: + # If a coordinate array has a single cell center, + # its corresponding cell size cannot be determined + # from neighboring centers. + raise TypeError(f"C has shape ({nrows}, {ncols}) but " + "shading='nearest' requires at least two rows " + "and two columns. Please supply explicit cell " + "edges for X and Y and use shading='flat' " + f"with {funcname}.") # grid is specified at the center, so define corners # at the midpoints between the grid centers and then use the # flat algorithm. @@ -6543,26 +6552,21 @@ def _interp_grid(X, require_monotonicity=False): # correctly, when expanding columns, the monotonicity of # X coords needs to be checked. When expanding rows, the # monotonicity of Y coords needs to be checked. - if np.shape(X)[1] > 1: - dX = np.diff(X, axis=1) * 0.5 - if (require_monotonicity and - not (np.all(dX >= 0) or np.all(dX <= 0))): - _api.warn_external( - f"The input coordinates to {funcname} are " - "interpreted as cell centers, but are not " - "monotonically increasing or decreasing. " - "This may lead to incorrectly calculated cell " - "edges, in which case, please supply " - f"explicit cell edges to {funcname}.") - - hstack = np.ma.hstack if np.ma.isMA(X) else np.hstack - X = hstack((X[:, [0]] - dX[:, [0]], - X[:, :-1] + dX, - X[:, [-1]] + dX[:, [-1]])) - else: - # This is just degenerate, but we can't reliably guess - # a dX if there is just one value. - X = np.hstack((X, X)) + dX = np.diff(X, axis=1) * 0.5 + if (require_monotonicity and + not (np.all(dX >= 0) or np.all(dX <= 0))): + _api.warn_external( + f"The input coordinates to {funcname} are " + "interpreted as cell centers, but are not " + "monotonically increasing or decreasing. " + "This may lead to incorrectly calculated cell " + "edges, in which case, please supply " + f"explicit cell edges to {funcname}.") + + hstack = np.ma.hstack if np.ma.isMA(X) else np.hstack + X = hstack((X[:, [0]] - dX[:, [0]], + X[:, :-1] + dX, + X[:, [-1]] + dX[:, [-1]])) return X if ncols == Nx: diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 531eae23db30..d111be6ea61c 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1678,6 +1678,18 @@ def test_pcolorargs(): # bad grid warnings. ax.pcolormesh(X+10*noise_X, Y+10*noise_Y, Z, shading='auto') assert len(record) == 2 + # Grid cannot contain a single row or single column for nearest shading. + x = [1, 2, 3] + y = [4] + Z = np.arange(3).reshape(1, 3) + with pytest.raises(TypeError): + ax.pcolormesh(Z, shading='nearest') + with pytest.raises(TypeError): + ax.pcolormesh(x, y, Z) + with pytest.raises(TypeError): + ax.pcolormesh(y, x, Z.T) + with pytest.raises(TypeError): + ax.pcolormesh(y, y, Z[:, [0]]) def test_pcolormesh_underflow_error(): From 8f5843713386ddd4ec147c173f619c675d7b279f Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 11 Oct 2026 15:15:48 +0200 Subject: [PATCH 119/210] DOC: Use :mpltype:`linestyle` for rcParams docs We already use :mpltype:`color`. This is now possible for linestyle through #32160. Note: As mentioned in `_Param`, `type` is currently only used for documentation, not for validation. Therefore, the focus is on helpful rending in the docs. --- lib/matplotlib/rcsetup.py | 42 +++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 024ded07568e..292943d3f53e 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -23,7 +23,7 @@ import os import re from typing import Any, Literal -from collections.abc import Callable, Sequence +from collections.abc import Callable import numpy as np @@ -1509,13 +1509,6 @@ def _convert_validator_spec(key, conv): ] -type _LineStyleType = ( - Literal["-", "solid", "--", "dashed", "-.", "dashdot", ":", "dotted", - "", "none", " ", "None"] | - tuple[float, Sequence[float]] -) - - type _MarkerType = int | str @@ -2459,7 +2452,7 @@ class _Subsection: _Param( "grid.linestyle", default="-", - type=_LineStyleType, + type=":mpltype:`linestyle`", validator=_validate_linestyle, description="The default grid line style." ), @@ -2488,7 +2481,7 @@ class _Subsection: _Param( "grid.major.linestyle", default=None, - type=_LineStyleType | None, + type=":mpltype:`linestyle` | None", validator=_validate_linestyle_or_None, description="If None defaults to grid.linestyle" ), @@ -2516,7 +2509,7 @@ class _Subsection: _Param( "grid.minor.linestyle", default=None, - type=_LineStyleType | None, + type=":mpltype:`linestyle` | None", validator=_validate_linestyle_or_None, description="If None defaults to grid.linestyle" ), @@ -2702,7 +2695,7 @@ class _Subsection: _Param( "lines.linestyle", default="-", - type=_LineStyleType, + type=":mpltype:`linestyle`", validator=_validate_linestyle, description="The default line style." ), @@ -3247,7 +3240,7 @@ class _Subsection: _Param( "contour.negative_linestyle", default="dashed", - type=_LineStyleType, + type=":mpltype:`linestyle`", validator=_validate_linestyle, description="The line style for negative contours, if *linestyle* is None " "and no color is specified." @@ -3346,34 +3339,34 @@ class _Subsection: description="The width of the flier marker edge, in points."), _Param("boxplot.flierprops.markersize", 6.0, float, validate_float, description="The flier marker size, in points."), - _Param("boxplot.flierprops.linestyle", "none", _LineStyleType, _validate_linestyle, - description="The line style of flier markers."), + _Param("boxplot.flierprops.linestyle", "none", ":mpltype:`linestyle`", + _validate_linestyle, description="The line style of flier markers."), _Param("boxplot.flierprops.linewidth", 1.0, float, validate_float, description="The line width of flier markers, in points."), _Param("boxplot.boxprops.color", "black", ':mpltype:`color`', validate_color, description="The box outline color."), _Param("boxplot.boxprops.linewidth", 1.0, float, validate_float, description="The box outline width, in points."), - _Param("boxplot.boxprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The box outline style."), + _Param("boxplot.boxprops.linestyle", "-", ":mpltype:`linestyle`", + _validate_linestyle, description="The box outline style."), _Param("boxplot.whiskerprops.color", "black", ':mpltype:`color`', validate_color, description="The whisker line color."), _Param("boxplot.whiskerprops.linewidth", 1.0, float, validate_float, description="The whisker line width, in points."), - _Param("boxplot.whiskerprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The whisker line style."), + _Param("boxplot.whiskerprops.linestyle", "-", ":mpltype:`linestyle`", + _validate_linestyle, description="The whisker line style."), _Param("boxplot.capprops.color", "black", ':mpltype:`color`', validate_color, description="The cap line color."), _Param("boxplot.capprops.linewidth", 1.0, float, validate_float, description="The cap line width, in points."), - _Param("boxplot.capprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The cap line style."), + _Param("boxplot.capprops.linestyle", "-", ":mpltype:`linestyle`", + _validate_linestyle, description="The cap line style."), _Param("boxplot.medianprops.color", "C1", ':mpltype:`color`', validate_color, description="The median line color."), _Param("boxplot.medianprops.linewidth", 1.0, float, validate_float, description="The median line width, in points."), - _Param("boxplot.medianprops.linestyle", "-", _LineStyleType, _validate_linestyle, - description="The median line style."), + _Param("boxplot.medianprops.linestyle", "-", ":mpltype:`linestyle`", + _validate_linestyle, description="The median line style."), _Param("boxplot.meanprops.color", "C2", ':mpltype:`color`', validate_color, description="The mean marker or line color."), _Param("boxplot.meanprops.marker", "^", _MarkerType, _validate_marker, @@ -3384,7 +3377,8 @@ class _Subsection: validate_color, description="The edge color of the mean marker."), _Param("boxplot.meanprops.markersize", 6.0, float, validate_float, description="The mean marker size, in points."), - _Param("boxplot.meanprops.linestyle", "--", _LineStyleType, _validate_linestyle, + _Param("boxplot.meanprops.linestyle", "--", ":mpltype:`linestyle`", + _validate_linestyle, description="The line style of the mean marker or line."), _Param("boxplot.meanprops.linewidth", 1.0, float, validate_float, description="The line width of the mean marker or line, in points."), From e3fc0dad9264588ea9d8c6488cc18be967b8bb8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ramos=20Carre=C3=B1o?= Date: Sun, 11 Oct 2026 21:22:47 +0200 Subject: [PATCH 120/210] Type `kwargs` as `Any` in `plt.show` (#32460) This should prevent Pyright from raising "partially unknown" errors on calls to `plt.show`, as explained in #27030. This is particularly annoying when writing Jupyter notebooks in Python format, which usually have many calls to `plt.show`. --- lib/matplotlib/pyplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 6671e07af64c..d02eea7281a0 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -591,7 +591,7 @@ def draw_if_interactive(*args, **kwargs): @overload -def show(*, block: bool, **kwargs) -> None: ... +def show(*, block: bool, **kwargs: Any) -> None: ... @overload From 4bcfe159d4eec6517ae2fd6b8d4adae866ab90e6 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 11 Oct 2026 23:24:04 +0200 Subject: [PATCH 121/210] DOC: Improve Axes rcParams descriptions --- lib/matplotlib/rcsetup.py | 88 ++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 024ded07568e..ff6bbedcae4d 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1749,21 +1749,21 @@ class _Subsection: default="white", type=":mpltype:`color`", validator=validate_color, - description="The axes background color." + description="Axes background color." ), _Param( "axes.edgecolor", default="black", type=":mpltype:`color`", validator=validate_color, - description="The axes edge color." + description="Axes edge color." ), _Param( "axes.linewidth", default=0.8, type=float, validator=validate_float, - description="The axes edge line width." + description="Axes edge line width in points." ), _Param( "axes.grid", @@ -1777,7 +1777,7 @@ class _Subsection: default="both", type=Literal["x", "y", "both"], validator=["x", "y", "both"], - description="Which axis the grid should apply to." + description="On which axis the grid is displayed." ), _Param( "axes.grid.which", @@ -1791,82 +1791,86 @@ class _Subsection: default="center", type=Literal["left", "center", "right"], validator=["left", "center", "right"], - description="The alignment of the axes title." + description="Horizontal location of the axes title." ), _Param( "axes.titlesize", default="large", type=_FontSizeType, validator=validate_fontsize, - description="The font size of the axes title." + description="Font size of the axes title." ), _Param( "axes.titleweight", default="normal", type=_FontWeightType, validator=validate_fontweight, - description="The font weight of the axes title." + description="Font weight of the axes title." ), _Param( "axes.titlecolor", default="auto", type=':mpltype:`color` or "auto"', validator=validate_color_or_auto, - description="The color of the axes title; auto falls back to 'text.color'." + description="Color of the axes title; 'auto' falls back to 'text.color'." ), _Param( "axes.titley", default=None, type=float | None, validator=validate_float_or_None, - description="The vertical title position in " - ":ref:`axes coordinates `; " - "None enables automatic placement." + description="Vertical axes title position.\n\n" + "A number specifies the text baseline in " + ":ref:`axes coordinates `. " + "None enables automatic placement so that the title bottom aligns " + "with the top of the Axes and potentially any top tick " + "labels.\n\n" + "The position will additionally be shifted by 'axes.titlepad'." ), _Param( "axes.titlepad", default=6.0, type=float, validator=validate_float, - description="The padding between the axes and title, in points." + description="Additional space between the Axes and title in points. This " + "shifts the title position determined by 'axes.titley'. " ), _Param( "axes.labelsize", default="medium", type=_FontSizeType, validator=validate_fontsize, - description="The font size of the x and y labels." + description="Font size of the x and y labels." ), _Param( "axes.labelpad", default=4.0, type=float, validator=validate_float, - description="The space between the axis label and the axis, in points." + description="The space between the axis label and the axis / tick labels, " + "in points." ), _Param( "axes.labelweight", default="normal", type=_FontWeightType, validator=validate_fontweight, - description="The font weight of the x and y labels." + description="Font weight of the x and y labels." ), _Param( "axes.labelcolor", default="black", type=":mpltype:`color`", validator=validate_color, - description="The color of the axis labels." + description="Color of the axis labels." ), _Param( "axes.axisbelow", default="line", type=bool | Literal["line"], validator=validate_axisbelow, - description="draw axis gridlines and ticks: " - "- below patches (True) " - "- above patches but below lines ('line') " - "- above all (False)" + description="Whether axis ticks and gridlines are above or below most artists. " + "See `~.Axes.set_axisbelow` for details." ), _Param( "axes.formatter.limits", @@ -1881,7 +1885,7 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="When True, format tick labels according to the user's locale. " + description="Whether to format tick labels according to the user's locale. " "For example, use ',' as a decimal separator in the fr_FR locale." ), _Param( @@ -1889,14 +1893,18 @@ class _Subsection: default=False, type=bool, validator=validate_bool, - description="When True, use mathtext for scientific notation." + description="Whether `.ScalarFormatter` and `.EngFormatter` use fancy " + r"formatting for scientific notation; i.e. :math:`1.2 \times 10^3` " + "instead of 1.2e3." ), _Param( "axes.formatter.min_exponent", default=0, type=int, validator=validate_int, - description="minimum exponent to format in scientific notation" + description="The smallest absolute exponent value that log formatters will " + "format as scientific notation; e.g. if set to 3, formatting will " + "1e-3, 0.01, 0.1, 0, 10, 100, 1e3." ), _Param( "axes.formatter.useoffset", @@ -1916,27 +1924,23 @@ class _Subsection: "remove at least this number of significant digits from tick " "labels." ), - _Param( - "axes.spines.left", - default=True, - type=bool, - validator=validate_bool, - description="display axis spines" - ), - _Param("axes.spines.bottom", True, bool, validate_bool, + _Param("axes.spines.left", default=True, type=bool, validator=validate_bool, + description="Whether to draw the left axis spine."), + _Param("axes.spines.bottom", default=True, type=bool, validator=validate_bool, description="Whether to draw the bottom axis spine."), - _Param("axes.spines.top", True, bool, validate_bool, + _Param("axes.spines.top", default=True, type=bool, validator=validate_bool, description="Whether to draw the top axis spine."), - _Param("axes.spines.right", True, bool, validate_bool, + _Param("axes.spines.right", default=True, type=bool, validator=validate_bool, description="Whether to draw the right axis spine."), _Param( "axes.unicode_minus", default=True, type=bool, validator=validate_bool, - description="use Unicode for the minus symbol rather than hyphen. See " - "https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes" - + description="Whether formatters will use the Unicode *Minus Sign* symbol " + "U+2212 (\N{MINUS SIGN}) rather than the ASCII hyphen U+002D (-) " + "for negative numbers. See also " + ":doc:`/gallery/text_labels_and_annotations/unicode_minus`." ), _Param( "axes.prop_cycle", @@ -1963,30 +1967,30 @@ class _Subsection: default=0.05, type=float, validator=_validate_greaterthan_minushalf, - description="x margin. See `~.axes.Axes.margins`" + description="x margin. See `~.axes.Axes.margins`." ), _Param( "axes.ymargin", default=0.05, type=float, validator=_validate_greaterthan_minushalf, - description="y margin. See `~.axes.Axes.margins`" + description="y margin. See `~.axes.Axes.margins`." ), _Param( "axes.zmargin", default=0.05, type=float, validator=_validate_greaterthan_minushalf, - description="z margin. See `~.axes.Axes.margins`" + description="z margin. See `~.axes.Axes.margins`." ), _Param( "axes.autolimit_mode", default="data", type=Literal["data", "round_numbers"], validator=["data", "round_numbers"], - description='If "data", use axes.xmargin and axes.ymargin as is. If ' - '"round_numbers", after application of margins, axis limits are ' - 'further expanded to the nearest "round" number.', + description='Whether autoscaling should try to adjust the view limits so that ' + 'there are ticks at the the axis edges. See ' + ':ref:`autoscaling-limit-rounding`.' ), _Subsection("Polar Axes"), _Param( From 16bc0a9c360a96952302f8fef448c354c8951f60 Mon Sep 17 00:00:00 2001 From: Sebastian Torres <72589869+astorress@users.noreply.github.com> Date: Mon, 12 Oct 2026 09:07:22 -0500 Subject: [PATCH 122/210] Add Pareto chart example to bars gallery - Shows a Pareto chart: sorted bar counts with a cumulative percentage - line on a secondary y-axis and an 80% reference line. --- .../lines_bars_and_markers/gallery_order.txt | 1 + .../lines_bars_and_markers/pareto_chart.py | 66 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 galleries/examples/lines_bars_and_markers/pareto_chart.py diff --git a/galleries/examples/lines_bars_and_markers/gallery_order.txt b/galleries/examples/lines_bars_and_markers/gallery_order.txt index b2f1e1a0c214..c9a710b8d7b0 100644 --- a/galleries/examples/lines_bars_and_markers/gallery_order.txt +++ b/galleries/examples/lines_bars_and_markers/gallery_order.txt @@ -22,6 +22,7 @@ gradient_bar barh horizontal_barchart_distribution broken_barh +pareto_chart # scatter scatter_demo2 diff --git a/galleries/examples/lines_bars_and_markers/pareto_chart.py b/galleries/examples/lines_bars_and_markers/pareto_chart.py new file mode 100644 index 000000000000..6492dad72417 --- /dev/null +++ b/galleries/examples/lines_bars_and_markers/pareto_chart.py @@ -0,0 +1,66 @@ +""" +============ +Pareto chart +============ + +A Pareto chart combines a bar chart of counts, sorted in descending order, +with a line showing the cumulative percentage. It is used to identify the +few categories that account for most of the total (the "vital few"). + +The cumulative line is drawn on a secondary y-axis created with +`.Axes.twinx`, and a dashed reference line at 80% marks the usual Pareto +threshold. +""" + +import matplotlib.pyplot as plt +import numpy as np + +from matplotlib.ticker import PercentFormatter + +# Mock data: number of defects found per category. +categories = ["Scratches", "Dents", "Misalignment", "Wrong color", + "Missing parts", "Cracks", "Other"] +counts = np.array([58, 42, 17, 9, 6, 4, 3]) + +# Sort in descending order and compute the cumulative percentage. +order = np.argsort(counts)[::-1] +categories = [categories[i] for i in order] +counts = counts[order] +cumulative_pct = np.cumsum(counts) / counts.sum() * 100 + +x = np.arange(len(categories)) + +fig, ax = plt.subplots(layout='constrained') + +ax.bar(x, counts, color='tab:blue') +ax.set_xticks(x, categories, rotation=30, ha='right') +ax.set_ylabel('Number of defects') +ax.set_title('Pareto chart of defects') + +ax2 = ax.twinx() # second Axes sharing the same x-axis +ax2.plot(x, cumulative_pct, color='tab:red', marker='o') +ax2.axhline(80, color='tab:gray', linestyle='--', linewidth=1) +ax2.set_ylim(0, 105) # headroom so the 100% marker is not clipped +ax2.yaxis.set_major_formatter(PercentFormatter(xmax=100)) +ax2.set_ylabel('Cumulative percentage') + +plt.show() + +# %% +# +# .. admonition:: References +# +# The use of the following functions, methods, classes and modules is shown +# in this example: +# +# - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` +# - `matplotlib.axes.Axes.twinx` / `matplotlib.pyplot.twinx` +# - `matplotlib.axes.Axes.set_xticks` / `matplotlib.pyplot.xticks` +# - `matplotlib.ticker.PercentFormatter` +# +# .. tags:: +# +# component: axes +# plot-type: bar +# plot-type: line +# level: beginner From 6321ac3fefb541f6a1c735c8973cd405633a5550 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Mon, 12 Oct 2026 19:35:51 +0000 Subject: [PATCH 123/210] BLD: Update minimum Python in meson.build to 3.12 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2c9b85acde38..384e300e900a 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'c', 'cpp', version: run_command( # Also keep version in sync with pyproject.toml. - find_program('python3', 'python', version: '>= 3.11'), + find_program('python3', 'python', version: '>= 3.12'), '-m', 'setuptools_scm', check: true).stdout().strip(), # qt_editor backend is MIT # STIX, Computer Modern, and Last Resort are OFL From 6e8f81d74e0c98cdea5cdf8bc8cc58b0973200a2 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Tue, 13 Oct 2026 09:26:32 +0000 Subject: [PATCH 124/210] MNT: Update numpy and pyparsing minimums in _check_versions --- lib/matplotlib/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index b7704e1f54c3..8b936e080a1b 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -253,8 +253,8 @@ def _check_versions(): ("cycler", "0.12.0"), ("dateutil", "2.7"), ("kiwisolver", "1.3.1"), - ("numpy", "1.25"), - ("pyparsing", "2.3.1"), + ("numpy", "2.0"), + ("pyparsing", "3.0"), ]: module = importlib.import_module(modname) if parse_version(module.__version__) < parse_version(minver): From 84760774ac554623d749b1f1ec7547dbe06db7b3 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Tue, 13 Oct 2026 20:36:46 +0000 Subject: [PATCH 125/210] DOC: Fix mouserotationstyle value for Shoemake's arcball --- doc/api/toolkits/mplot3d/view_angles.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/toolkits/mplot3d/view_angles.rst b/doc/api/toolkits/mplot3d/view_angles.rst index e4200cd2d0e4..8ce018692828 100644 --- a/doc/api/toolkits/mplot3d/view_angles.rst +++ b/doc/api/toolkits/mplot3d/view_angles.rst @@ -71,7 +71,7 @@ A different variety of trackball rotates along the shortest arc on the virtual sphere (``mouserotationstyle: sphere``). Rotating around the viewing direction is straightforward with it: grab the ball near its edge instead of near the center. -Ken Shoemake's ARCBALL [Shoemake1992]_ is also available (``mouserotationstyle: Shoemake``); +Ken Shoemake's ARCBALL [Shoemake1992]_ is also available (``mouserotationstyle: arcball``); it resembles the ``sphere`` style, but is free of hysteresis, i.e., returning mouse to the original position returns the figure to its original orientation; the rotation is independent From a009fbaf219d507a24a1c1d4050db7eac876761b Mon Sep 17 00:00:00 2001 From: Shamik Basu Date: Tue, 13 Oct 2026 21:33:25 -0700 Subject: [PATCH 126/210] Fix Line3D.draw AttributeError for list coordinates with NaN (#32306) * Fix Line3D.draw AttributeError for list coordinates with NaN set_data_3d documents array-like input but stored values verbatim, while draw assumes .shape. Coerce with np.asarray so invalid-scale masking works. Co-authored-by: Cursor * Drop comment on set_data_3d asarray coercion. Co-authored-by: Cursor * Use np.shape in Line3D.draw for array-like coords. Keep set_data_3d storing inputs as given so get_data_3d behavior is unchanged, and make draw tolerate lists/tuples when masking invalid scale values. Co-authored-by: Cursor --------- Co-authored-by: Cursor --- lib/mpl_toolkits/mplot3d/art3d.py | 2 +- lib/mpl_toolkits/mplot3d/tests/test_art3d.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py index b0d7312bff3d..c165a3e1e453 100644 --- a/lib/mpl_toolkits/mplot3d/art3d.py +++ b/lib/mpl_toolkits/mplot3d/art3d.py @@ -360,7 +360,7 @@ def draw(self, renderer): if np.any(scale_mask): mask = np.broadcast_to( scale_mask, - (len(self._verts3d), *self._verts3d[0].shape) + (len(self._verts3d), *np.shape(self._verts3d[0])) ) xs3d, ys3d, zs3d = np.ma.array(self._verts3d, dtype=float, mask=mask).filled(np.nan) diff --git a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py index aca943f9e0c0..c38f0c744531 100644 --- a/lib/mpl_toolkits/mplot3d/tests/test_art3d.py +++ b/lib/mpl_toolkits/mplot3d/tests/test_art3d.py @@ -13,6 +13,18 @@ ) +def test_line3d_set_data_3d_list_with_nan(): + # Regression test for #32127: set_data_3d stores array-like as given, and + # draw must not require ndarray .shape when a coordinate is non-finite. + fig = plt.figure() + ax = fig.add_subplot(projection="3d") + line, = ax.plot([0.0], [0.0], [0.0]) + xs, ys, zs = [float("nan")], [float("nan")], [float("nan")] + line.set_data_3d(xs, ys, zs) + assert line.get_data_3d() == (xs, ys, zs) + fig.canvas.draw() + + @pytest.mark.parametrize("zdir, expected", [ ("x", (1, 0, 0)), ("y", (0, 1, 0)), From 31bdf44e949eeb93fcf17844ed2d0adade84bc47 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Wed, 14 Oct 2026 11:50:09 +0000 Subject: [PATCH 127/210] DOC: Update build dependency minimums and fix broken ImageMagick link --- doc/install/dependencies.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/install/dependencies.rst b/doc/install/dependencies.rst index 68cd0e77d599..1e91b0dbb3bd 100644 --- a/doc/install/dependencies.rst +++ b/doc/install/dependencies.rst @@ -91,7 +91,7 @@ Animations ^^^^^^^^^^ * ffmpeg_: for saving movies. -* `ImageMagick `_: for saving +* `ImageMagick `_: for saving animated gifs. Font handling and rendering @@ -238,12 +238,12 @@ means that the dependencies must be explicitly installed, either by :ref:`creati (recommended) or by manually installing the following packages: - `meson-python `_ (>= 0.13.1). -- `PyBind11 `_ (>= 2.13.2). Used to connect C/C++ code +- `PyBind11 `_ (>= 3.0.0). Used to connect C/C++ code with Python. - `setuptools_scm `_ (>= 7). Used to update the reported ``mpl.__version__`` based on the current git commit. Also a runtime dependency for editable installs. -- NumPy_ (>= 1.22). Also a runtime dependency. +- NumPy_ (>= 2.0). Also a runtime dependency. .. _compile-build-dependencies: From 1d5b096284c0e8ba5db6e70149702757b3596365 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:14:27 +0200 Subject: [PATCH 128/210] Apply batched suggestions from code review Co-authored-by: Elliott Sales de Andrade Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> --- lib/matplotlib/rcsetup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index ff6bbedcae4d..688483a350f3 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1833,7 +1833,7 @@ class _Subsection: type=float, validator=validate_float, description="Additional space between the Axes and title in points. This " - "shifts the title position determined by 'axes.titley'. " + "shifts the title position determined by 'axes.titley'." ), _Param( "axes.labelsize", @@ -1904,7 +1904,7 @@ class _Subsection: validator=validate_int, description="The smallest absolute exponent value that log formatters will " "format as scientific notation; e.g. if set to 3, formatting will " - "1e-3, 0.01, 0.1, 0, 10, 100, 1e3." + "be 1e-3, 0.01, 0.1, 0, 10, 100, 1e3." ), _Param( "axes.formatter.useoffset", @@ -1989,7 +1989,7 @@ class _Subsection: type=Literal["data", "round_numbers"], validator=["data", "round_numbers"], description='Whether autoscaling should try to adjust the view limits so that ' - 'there are ticks at the the axis edges. See ' + 'there are ticks at the axis edges. See ' ':ref:`autoscaling-limit-rounding`.' ), _Subsection("Polar Axes"), From eaef4ce3c89267674dfecaeeb2b43b1f7a6f51ed Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:30:02 +0200 Subject: [PATCH 129/210] Apply suggestion from @timhoffm --- lib/matplotlib/colorbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index c787889e796e..58b3240eee78 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -448,7 +448,7 @@ def _patch_ax_methods(self): "_set_view_from_bbox", "drag_pan"] for x in self._interactive_funcs: setattr(self.ax, x, getattr(self, x)) - # Override cla Set the cla function to the cbar's method to override it + # Override the cla method with a cbar-specific implementation self.ax.cla = self._cbar_cla def _cbar_cla(self): From 06fb9965b05c6d199b8ae7efb4bb1a0ad3303b63 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Thu, 15 Oct 2026 00:05:05 +0000 Subject: [PATCH 130/210] DOC: Remove ActivePython and update MacPorts pip port in install guide --- doc/install/index.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/install/index.rst b/doc/install/index.rst index 4e8792dd5d32..8678af8252a5 100644 --- a/doc/install/index.rst +++ b/doc/install/index.rst @@ -71,8 +71,6 @@ Python distributions Matplotlib is part of major Python distributions: - Anaconda_ -- `ActiveState ActivePython - `_ - `WinPython `_ Linux package manager @@ -248,7 +246,7 @@ the form of wheels. pip is installed by default with python.org and Homebrew Python, but needs to be manually installed on Macports with :: - sudo port install py38-pip + sudo port install py314-pip Once pip is installed, you can install Matplotlib and all its dependencies with from the Terminal.app command line:: From c5c615d1698f816326f5fa2dc84ad8c99b4373e8 Mon Sep 17 00:00:00 2001 From: Sebastian Torres Date: Wed, 14 Oct 2026 19:21:12 -0500 Subject: [PATCH 131/210] DOC: Align Pareto chart axes using secondary_yaxis Plot the cumulative counts on the same axis as the bars so the left axis spans 0 to the total count, and use Axes.secondary_yaxis to show the same scale as a percentage. This keeps 100% aligned with the total count. --- .../lines_bars_and_markers/pareto_chart.py | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/galleries/examples/lines_bars_and_markers/pareto_chart.py b/galleries/examples/lines_bars_and_markers/pareto_chart.py index 6492dad72417..7d02d1e861cd 100644 --- a/galleries/examples/lines_bars_and_markers/pareto_chart.py +++ b/galleries/examples/lines_bars_and_markers/pareto_chart.py @@ -7,8 +7,10 @@ with a line showing the cumulative percentage. It is used to identify the few categories that account for most of the total (the "vital few"). -The cumulative line is drawn on a secondary y-axis created with -`.Axes.twinx`, and a dashed reference line at 80% marks the usual Pareto +The cumulative line is drawn against the same y-axis as the bars, so the left +axis runs from 0 to the total count. A secondary y-axis created with +`.Axes.secondary_yaxis` relabels the same scale as a percentage, keeping both +axes aligned, and a dashed reference line at 80% marks the usual Pareto threshold. """ @@ -22,11 +24,11 @@ "Missing parts", "Cracks", "Other"] counts = np.array([58, 42, 17, 9, 6, 4, 3]) -# Sort in descending order and compute the cumulative percentage. +# Sort in descending order. order = np.argsort(counts)[::-1] categories = [categories[i] for i in order] counts = counts[order] -cumulative_pct = np.cumsum(counts) / counts.sum() * 100 +total = counts.sum() x = np.arange(len(categories)) @@ -37,12 +39,15 @@ ax.set_ylabel('Number of defects') ax.set_title('Pareto chart of defects') -ax2 = ax.twinx() # second Axes sharing the same x-axis -ax2.plot(x, cumulative_pct, color='tab:red', marker='o') -ax2.axhline(80, color='tab:gray', linestyle='--', linewidth=1) -ax2.set_ylim(0, 105) # headroom so the 100% marker is not clipped -ax2.yaxis.set_major_formatter(PercentFormatter(xmax=100)) -ax2.set_ylabel('Cumulative percentage') +ax.plot(x, np.cumsum(counts), color='tab:red', marker='o') +ax.axhline(0.8 * total, color='tab:gray', linestyle='--', linewidth=1) +ax.set_ylim(0, total * 1.05) # headroom so the 100% marker is not clipped + +# Secondary axis that maps counts to a percentage of the total (and back). +secax = ax.secondary_yaxis('right', functions=(lambda c: c / total * 100, + lambda p: p / 100 * total)) +secax.yaxis.set_major_formatter(PercentFormatter()) +secax.set_ylabel('Cumulative percentage') plt.show() @@ -54,7 +59,7 @@ # in this example: # # - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` -# - `matplotlib.axes.Axes.twinx` / `matplotlib.pyplot.twinx` +# - `matplotlib.axes.Axes.secondary_yaxis` # - `matplotlib.axes.Axes.set_xticks` / `matplotlib.pyplot.xticks` # - `matplotlib.ticker.PercentFormatter` # From 99150ec87d1f68c5ee81fe311c7e246ee2466edb Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Fri, 4 Sep 2026 09:26:52 -1000 Subject: [PATCH 132/210] animation.py: Stop event sources instead of nullifying them on animation stop --- .../animation_stop_event_stop_not_null.rst | 22 ++++++++++++ lib/matplotlib/animation.py | 4 +-- lib/matplotlib/animation.pyi | 2 +- lib/matplotlib/tests/test_animation.py | 34 ++++++++++++++++++- 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 doc/api/next_api_changes/behavior/animation_stop_event_stop_not_null.rst diff --git a/doc/api/next_api_changes/behavior/animation_stop_event_stop_not_null.rst b/doc/api/next_api_changes/behavior/animation_stop_event_stop_not_null.rst new file mode 100644 index 000000000000..728c93c49369 --- /dev/null +++ b/doc/api/next_api_changes/behavior/animation_stop_event_stop_not_null.rst @@ -0,0 +1,22 @@ +``TimedAnimation``/``Animation`` no longer set to None when an animation stops +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously upon animation completion or fig close ``.Animation.event_source`` +was set to ``None``. Now the event source is stopped and retained on +the animation. + +The following code snippet would before have returned None but would now return a +``matplotlib.backend_bases.TimerBase``. Code that used None to check for successful +stoppage should be updated. + +.. code-block:: python + + import matplotlib + matplotlib.use('agg') + import matplotlib.pyplot as plt + from matplotlib.animation import FuncAnimation + + fig, ax = plt.subplots() + anim = FuncAnimation(fig, lambda f: [], frames=3, repeat=False) + # Wait for the animation to finish. + print(anim.event_source) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index ad303cbb92e9..b29885646a56 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -946,7 +946,7 @@ def _stop(self, *args): self._fig.canvas.mpl_disconnect(self._resize_id) self._fig.canvas.mpl_disconnect(self._close_id) self.event_source.remove_callback(self._step) - self.event_source = None + self.event_source.stop() def save(self, filename, writer=None, fps=None, dpi=None, codec=None, bitrate=None, extra_args=None, metadata=None, extra_anim=None, @@ -1483,7 +1483,7 @@ def _step(self, *args): # Remove the resize callback if we were blitting self._fig.canvas.mpl_disconnect(self._resize_id) self._fig.canvas.mpl_disconnect(self._close_id) - self.event_source = None + self.event_source.stop() return False self.event_source.interval = self._interval diff --git a/lib/matplotlib/animation.pyi b/lib/matplotlib/animation.pyi index e90a0103aefd..4c477be23063 100644 --- a/lib/matplotlib/animation.pyi +++ b/lib/matplotlib/animation.pyi @@ -160,7 +160,7 @@ class EventSourceProtocol(Protocol): class Animation: frame_seq: Iterable[Artist] - event_source: EventSourceProtocol | None # TODO: We should remove None + event_source: EventSourceProtocol def __init__( self, fig: Figure, event_source: EventSourceProtocol, blit: bool = ... ) -> None: ... diff --git a/lib/matplotlib/tests/test_animation.py b/lib/matplotlib/tests/test_animation.py index 9beb025c2a2e..da7db569cd50 100644 --- a/lib/matplotlib/tests/test_animation.py +++ b/lib/matplotlib/tests/test_animation.py @@ -13,7 +13,7 @@ import matplotlib as mpl from matplotlib import pyplot as plt from matplotlib import animation -from matplotlib.animation import PillowWriter +from matplotlib.animation import PillowWriter, FuncAnimation from matplotlib.testing.decorators import check_figures_equal @@ -571,3 +571,35 @@ def test_animation_with_transparency(): # Check that the alpha channel is not 255, so frame has transparency assert frame.getextrema()[3][0] < 255 plt.close(fig) + + +def test_event_source_stops_leaves_event(): + """ + Added for issue #30622 + + Tests that animations now stop the event source + on animation completion. + """ + fig, ax = plt.subplots() + anim = FuncAnimation(fig, lambda f: [], frames=3, repeat=False) + anim._start() + while anim._step(): + pass # goes through all 3 steps + assert anim.event_source is not None + + +def test_event_source_stops_early_leaves_event(): + """ + Added for issue #30622 + + Tests that animations now stop the event source instead + of destroying it on animation early stop. + """ + fig, ax = plt.subplots() + anim = FuncAnimation(fig, lambda f: [], frames=3) + anim._start() + # plt.close(fig) is needed here because, without it, stop + # is not called. So, event_source would still be not None + # and that is not the behaviour we are exercising. + plt.close(fig) + assert anim.event_source is not None From b9a6ff6147f1a96844c89b784f06c3c85e0953fb Mon Sep 17 00:00:00 2001 From: Nillohit Roy Date: Thu, 15 Oct 2026 13:27:11 +0530 Subject: [PATCH 133/210] Addressed Review: add 'none' support, use physical coordinates for labels and updated docstrings --- lib/matplotlib/figure.py | 131 ++++++++++++++++++++++------ lib/matplotlib/figure.pyi | 12 +-- lib/matplotlib/pyplot.py | 25 +++--- lib/matplotlib/tests/test_figure.py | 15 +++- 4 files changed, 134 insertions(+), 49 deletions(-) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index b79eaefcdcb4..5879e24f431c 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2117,14 +2117,44 @@ def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False, per_subplot_kw = self._norm_per_subplot_kw(per_subplot_kw) - # Custom Validation Function to check for booleans and strings. def _validate_share_param(param_name, value): + """ + Validate and normalize the sharex or sharey parameter. + + Parameters + ---------- + param_name : str + The name of the parameter being validated (e.g., 'sharex'). + value : bool or {'all', 'none', 'row', 'col'} + The sharing mode requested by the user: + - 'row': Axes sharing the exact same row span within the + same GridSpec will share this axis. + - 'col': Axes sharing the exact same column span within the + same GridSpec will share this axis. + - 'all' or True: All generated axes will share this axis. + - 'none' or False: No axes will share this axis. + + Returns + ------- + bool or {'row', 'col'} + The normalized sharing mode. 'all' is converted to True, + and 'none' is converted to False. + + Raises + ------ + ValueError + If the provided value is not a valid sharing mode. + """ if type(value) is bool: return value - if value in ["all", "row", "col"]: + if value == "all": + return True + if value == "none": + return False + if value in ["row", "col"]: return value raise ValueError( - f"{param_name} must be True, False, 'all', 'row', or 'col'" + f"{param_name} must be True, False, 'all', 'none', 'row', or 'col'" ) sharex = _validate_share_param("sharex", sharex) @@ -2286,28 +2316,65 @@ def _do_layout(gs, mosaic, unique_ids, nested): mosaic = _make_array(mosaic) rows, cols = mosaic.shape gs = self.add_gridspec(rows, cols, **gridspec_kw) - ret = _do_layout(gs, mosaic, *_identify_keys_and_nested(mosaic)) - # Asymmetrical/Directional Implementation that needs to be changed - # ax0 = next(iter(ret.values())) - # for ax in ret.values(): - # if sharex: - # ax.sharex(ax0) - # ax._label_outer_xaxis(skip_non_rectangular_axes=True) - # if sharey: - # ax.sharey(ax0) - # ax._label_outer_yaxis(skip_non_rectangular_axes=True) + ax_dict = _do_layout(gs, mosaic, *_identify_keys_and_nested(mosaic)) # Symmetric Sharing - def _apply_sharing(ret_dict, share_val, axis_name): - if share_val is False: + def _apply_sharing(ax_dict, share_val, axis_name): + """ + Apply axis sharing and manage tick label visibility for a generated + mosaic of Axes. + + This function groups Axes based on their GridSpec layout spans and the + requested sharing mode. It binds the specified axis (`x` or `y`) within + each group. + + To prevent overlapping or redundant labels, especially in complex or + nested layouts, it evaluates the physical figure coordinates of each + shared group. It dynamically disables tick labels for all Axes except + those on the outermost physical boundary (e.g., the bottom-most Axes + for a shared x-axis, or the left-most Axes for a shared y-axis). + + Parameters + ---------- + ax_dict : dict[label, Axes] + A flat dictionary mapping user-defined string labels to all Axes + objects created in the layout. + share_val : bool or {'all', 'none', 'row', 'col'} + The requested sharing mode to apply: + - `True` or 'all': Shares the axis across all Axes in the mosaic. + - `'row'`: Groups and shares the axis for Axes occupying the + exact same row span within the same GridSpec. + - `'col'`: Groups and shares the axis for Axes occupying the + exact same column span within the same GridSpec. + - `False` or 'none': No sharing is applied, and the function + exits early. + axis_name : {'x', 'y'} + The specific axis to apply the sharing and visibility rules to. + + Examples + -------- + >>> _apply_sharing(ax_dict, share_val='col', axis_name='x') + + Share the x-axis for plots sitting in the same column, hiding the + x-tick labels for all but the bottom-most plot in that column: + + >>> _apply_sharing(ax_dict, share_val=True, axis_name='y') + + Share the y-axis across every plot in the entire mosaic, hiding all + y-tick labels except for the plots sitting on the absolute left-most + physical edge of the figure: + """ + # Safely handle both False and "none" as a complete exit + if share_val is False or share_val == "none": return # Group the axes based on their spans groups = {} - for ax in ret_dict.values(): + for ax in ax_dict.values(): span = ax.get_subplotspec() grid = span.get_gridspec() + # Safely handle both True and "all" if share_val is True or share_val == "all": groups.setdefault("all", []).append(ax) elif share_val == "row": @@ -2331,29 +2398,39 @@ def _apply_sharing(ret_dict, share_val, axis_name): else: child_ax.sharey(parent) - # Handle tick label visibility per isolated group + # Handle tick label visibility per isolated group using physical + # coordinates if axis_name == 'x': - # Find the bottom-most edge within a specific group - bottom_edge = max(ax.get_subplotspec().rowspan.stop for ax in group) + # Find the physical bottom-most edge (minimum y-coordinate) + bottom_edge = min( + ax.get_subplotspec().get_position(self).ymin + for ax in group + ) for ax in group: - if ax.get_subplotspec().rowspan.stop < bottom_edge: + # Float tolerance of 1e-5 to account for rounding errors + pos = ax.get_subplotspec().get_position(self) + if pos.ymin > bottom_edge + 1e-5: ax.tick_params(labelbottom=False) else: - # Find the left-most edge within a specific group - left_edge = min(ax.get_subplotspec().colspan.start for ax in group) + # Find the physical left-most edge (minimum x-coordinate) + left_edge = min( + ax.get_subplotspec().get_position(self).xmin + for ax in group + ) for ax in group: - if ax.get_subplotspec().colspan.start > left_edge: + pos = ax.get_subplotspec().get_position(self) + if pos.xmin > left_edge + 1e-5: ax.tick_params(labelleft=False) - _apply_sharing(ret, sharex, 'x') - _apply_sharing(ret, sharey, 'y') + _apply_sharing(ax_dict, sharex, 'x') + _apply_sharing(ax_dict, sharey, 'y') - if extra := set(per_subplot_kw) - set(ret): + if extra := set(per_subplot_kw) - set(ax_dict): raise ValueError( f"The keys {extra} are in *per_subplot_kw* " "but not in the mosaic." ) - return ret + return ax_dict def _set_artist_props(self, a): if a != self: diff --git a/lib/matplotlib/figure.pyi b/lib/matplotlib/figure.pyi index 4046011ad717..6d6d1b0ff386 100644 --- a/lib/matplotlib/figure.pyi +++ b/lib/matplotlib/figure.pyi @@ -255,8 +255,8 @@ class FigureBase(Artist): self, mosaic: str, *, - sharex: bool | Literal["all", "row", "col"] = ..., - sharey: bool | Literal["all", "row", "col"] = ..., + sharex: bool | Literal["all", "none", "row", "col"] = ..., + sharey: bool | Literal["all", "none", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: str = ..., @@ -269,8 +269,8 @@ class FigureBase(Artist): self, mosaic: list[HashableList[T]], *, - sharex: bool | Literal["all", "row", "col"] = ..., - sharey: bool | Literal["all", "row", "col"] = ..., + sharex: bool | Literal["all", "none", "row", "col"] = ..., + sharey: bool | Literal["all", "none", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: T = ..., @@ -283,8 +283,8 @@ class FigureBase(Artist): self, mosaic: list[HashableList[Hashable]], *, - sharex: bool | Literal["all", "row", "col"] = ..., - sharey: bool | Literal["all", "row", "col"] = ..., + sharex: bool | Literal["all", "none", "row", "col"] = ..., + sharey: bool | Literal["all", "none", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: Any = ..., diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index daae7ee0fac6..4293bfff35f0 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1896,8 +1896,8 @@ def subplots( def subplot_mosaic( mosaic: str, *, - sharex: bool | Literal["all", "row", "col"] = ..., - sharey: bool | Literal["all", "row", "col"] = ..., + sharex: bool | Literal["all", "none", "row", "col"] = ..., + sharey: bool | Literal["all", "none", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: str = ..., @@ -1912,8 +1912,8 @@ def subplot_mosaic( def subplot_mosaic[T]( mosaic: list[HashableList[T]], *, - sharex: bool | Literal["all", "row", "col"] = ..., - sharey: bool | Literal["all", "row", "col"] = ..., + sharex: bool | Literal["all", "none", "row", "col"] = ..., + sharey: bool | Literal["all", "none", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: T = ..., @@ -1928,8 +1928,8 @@ def subplot_mosaic[T]( def subplot_mosaic( mosaic: list[HashableList[Hashable]], *, - sharex: bool | Literal["all", "row", "col"] = ..., - sharey: bool | Literal["all", "row", "col"] = ..., + sharex: bool | Literal["all", "none", "row", "col"] = ..., + sharey: bool | Literal["all", "none", "row", "col"] = ..., width_ratios: ArrayLike | None = ..., height_ratios: ArrayLike | None = ..., empty_sentinel: Any = ..., @@ -1943,8 +1943,8 @@ def subplot_mosaic( def subplot_mosaic[T]( mosaic: str | list[HashableList[T]] | list[HashableList[Hashable]], *, - sharex: bool | Literal["all", "row", "col"] = False, - sharey: bool | Literal["all", "row", "col"] = False, + sharex: bool | Literal["all", "none", "row", "col"] = False, + sharey: bool | Literal["all", "none", "row", "col"] = False, width_ratios: ArrayLike | None = None, height_ratios: ArrayLike | None = None, empty_sentinel: Any = '.', @@ -1996,11 +1996,12 @@ def subplot_mosaic[T]( This only allows only single character Axes labels and does not allow nesting but is very terse. - sharex, sharey : bool, default: False - If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared + sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False + If True or 'all', the x-axis (*sharex*) or y-axis (*sharey*) will be shared among all subplots. In that case, tick label visibility and axis units - behave as for `subplots`. If False, each subplot's x- or y-axis will - be independent. + behave as for `subplots`. If 'row', each subplot row will share an x-axis + (or y-axis). If 'col', each subplot column will share an x-axis (or y-axis). + If False or 'none', each subplot's x- or y-axis will be independent. width_ratios : array-like of length *ncols*, optional Defines the relative widths of the columns. Each column gets a diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py index e67e37e51ae7..06e3f7320145 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -1320,7 +1320,7 @@ def test_nested_user_order(self): assert list(ax_dict) == list("ABCDEFGHI") assert list(fig.axes) == list(ax_dict.values()) - @pytest.mark.parametrize("share_val", [True, "all"]) + @pytest.mark.parametrize("share_val", [True, "all", False, "none"]) def test_share_all(self, share_val): layout = [ ["A", [["B", "C"], @@ -1332,8 +1332,15 @@ def test_share_all(self, share_val): fig = plt.figure() ax_dict = fig.subplot_mosaic(layout, sharex=share_val, sharey=share_val) ax_dict["A"].set(xscale="log", yscale="logit") - assert all(ax.get_xscale() == "log" and ax.get_yscale() == "logit" - for ax in ax_dict.values()) + + # If sharing is True or "all", all axes should match "A" + if share_val in [True, "all"]: + assert all(ax.get_xscale() == "log" and ax.get_yscale() == "logit" + for ax in ax_dict.values()) + # If sharing is False or "none", only "A" should be changed + else: + assert ax_dict["A"].get_xscale() == "log" + assert ax_dict["B"].get_xscale() != "log" def test_share_row_col(self): layout = [ @@ -1364,7 +1371,7 @@ def test_share_invalid(self): ] fig = plt.figure() - msg = "must be True, False, 'all', 'row', or 'col'" + msg = "must be True, False, 'all', 'none', 'row', or 'col'" with pytest.raises(ValueError, match=msg): fig.subplot_mosaic(layout, sharex="invalid_string") From e578eb40d92c9c2a46786d3a33487ff1fb8fb9f7 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 16 Oct 2026 00:55:59 +0200 Subject: [PATCH 134/210] fix missing link target --- galleries/users_explain/axes/autoscale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/galleries/users_explain/axes/autoscale.py b/galleries/users_explain/axes/autoscale.py index 22cdd1f8dc96..f108480d5a09 100644 --- a/galleries/users_explain/axes/autoscale.py +++ b/galleries/users_explain/axes/autoscale.py @@ -299,6 +299,8 @@ # are not affected. Setting ``Axes.use_sticky_edges = False`` disables sticky # edge clamping on that Axes. # +# .. _autoscaling-limit-rounding: +# # Limit rounding # ~~~~~~~~~~~~~~ # From 3c93967ec6424284ec7764934d7b88d251a765fa Mon Sep 17 00:00:00 2001 From: Sebastian Torres Date: Thu, 15 Oct 2026 20:11:07 -0500 Subject: [PATCH 135/210] DOC: Refactor Pareto chart example into a helper function --- .../lines_bars_and_markers/pareto_chart.py | 56 ++++++++++++------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/galleries/examples/lines_bars_and_markers/pareto_chart.py b/galleries/examples/lines_bars_and_markers/pareto_chart.py index 7d02d1e861cd..b02aa516f784 100644 --- a/galleries/examples/lines_bars_and_markers/pareto_chart.py +++ b/galleries/examples/lines_bars_and_markers/pareto_chart.py @@ -24,31 +24,47 @@ "Missing parts", "Cracks", "Other"] counts = np.array([58, 42, 17, 9, 6, 4, 3]) -# Sort in descending order. -order = np.argsort(counts)[::-1] -categories = [categories[i] for i in order] -counts = counts[order] -total = counts.sum() -x = np.arange(len(categories)) +def pareto_chart(categories, counts): + """ + Parameters + ---------- + categories : list of str + The category labels. + counts : array-like + The number of occurrences of each category. -fig, ax = plt.subplots(layout='constrained') + Returns + ------- + fig, ax : `.Figure`, `~matplotlib.axes.Axes` + """ + # Sort in descending order. + order = np.argsort(counts)[::-1] + categories = [categories[i] for i in order] + counts = np.asarray(counts)[order] + total = counts.sum() -ax.bar(x, counts, color='tab:blue') -ax.set_xticks(x, categories, rotation=30, ha='right') -ax.set_ylabel('Number of defects') -ax.set_title('Pareto chart of defects') + fig, ax = plt.subplots(layout='constrained') -ax.plot(x, np.cumsum(counts), color='tab:red', marker='o') -ax.axhline(0.8 * total, color='tab:gray', linestyle='--', linewidth=1) -ax.set_ylim(0, total * 1.05) # headroom so the 100% marker is not clipped + ax.bar(categories, counts) + ax.tick_params(axis='x', rotation=30, labelrotation_mode='xtick') + ax.set_ylabel('Number of defects') + ax.set_title('Pareto chart of defects') -# Secondary axis that maps counts to a percentage of the total (and back). -secax = ax.secondary_yaxis('right', functions=(lambda c: c / total * 100, - lambda p: p / 100 * total)) -secax.yaxis.set_major_formatter(PercentFormatter()) -secax.set_ylabel('Cumulative percentage') + ax.plot(categories, np.cumsum(counts), color='tab:red', marker='o') + ax.axhline(0.8 * total, color='tab:gray', linestyle='--', linewidth=1) + ax.set_ylim(0, total * 1.05) # headroom so the 100% marker is not clipped + # Secondary axis that maps counts to a percentage of the total (and back). + secax = ax.secondary_yaxis('right', functions=(lambda c: c / total * 100, + lambda p: p / 100 * total)) + secax.yaxis.set_major_formatter(PercentFormatter()) + secax.set_ylabel('Cumulative percentage') + + return fig, ax + + +pareto_chart(categories, counts) plt.show() # %% @@ -60,7 +76,7 @@ # # - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` # - `matplotlib.axes.Axes.secondary_yaxis` -# - `matplotlib.axes.Axes.set_xticks` / `matplotlib.pyplot.xticks` +# - `matplotlib.axes.Axes.tick_params` / `matplotlib.pyplot.tick_params` # - `matplotlib.ticker.PercentFormatter` # # .. tags:: From 2ce86a7fed58a83c7455946755ae1d193207f418 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Thu, 15 Oct 2026 21:22:31 -0700 Subject: [PATCH 136/210] Only access AA_UseHighDpiPixmaps in Qt5 --- lib/matplotlib/backends/backend_qt.py | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/matplotlib/backends/backend_qt.py b/lib/matplotlib/backends/backend_qt.py index cd6c6bb33a9b..a6793c4b213c 100644 --- a/lib/matplotlib/backends/backend_qt.py +++ b/lib/matplotlib/backends/backend_qt.py @@ -94,6 +94,20 @@ def _create_WindowIcon(): return icon +# Set in _create_qApp() +_qt_version = None + + +# AA_UseHighDpiPixmaps on Qt6 is deprecated and will always return True. +# PySide6 will log or throw a DeprecationWarning when we try to access it. +def _test_app_attribute_UseHighDpiPixmaps(): + if _qt_version == 5: + app = QtWidgets.QApplication.instance() + return app.testAttribute(QtCore.Qt.AA_UseHighDpiPixmaps) + else: + return True + + # lru_cache keeps a reference to the QApplication instance, keeping it from # being GC'd. @functools.lru_cache(1) @@ -110,12 +124,14 @@ def _create_qApp(): # Check to make sure a QApplication from a different major version # of Qt is not instantiated in the process + global _qt_version + if QT_API in {'PyQt6', 'PySide6'}: other_bindings = ('PyQt5',) - qt_version = 6 + _qt_version = 6 elif QT_API == 'PyQt5': other_bindings = ('PyQt6', 'PySide6') - qt_version = 5 + _qt_version = 5 else: raise RuntimeError("Should never be here") @@ -131,7 +147,7 @@ def _create_qApp(): 'versions may not work as expected.' ) break - if qt_version == 5: + if _qt_version == 5: try: QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) except AttributeError: # Only for Qt>=5.6, <6. @@ -146,7 +162,7 @@ def _create_qApp(): app.setWindowIcon(_create_WindowIcon()) app.setQuitOnLastWindowClosed(True) cbook._setup_new_guiapp() - if qt_version == 5: + if _qt_version == 5: app.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps) return app @@ -726,12 +742,8 @@ def pixmap(self, size, mode, state): def _devicePixelRatio(self): """Return the current device pixel ratio for the toolbar, defaulting to 1.""" - use_high_dpi_pixmaps = True - if hasattr(QtCore.Qt.ApplicationAttribute, "AA_UseHighDpiPixmaps"): - app = QtWidgets.QApplication.instance() - use_high_dpi_pixmaps = app.testAttribute(QtCore.Qt.AA_UseHighDpiPixmaps) toolbar_dpr = (self.toolbar.devicePixelRatioF() or 1) if self.toolbar else 1 - return toolbar_dpr if use_high_dpi_pixmaps else 1 + return toolbar_dpr if _test_app_attribute_UseHighDpiPixmaps() else 1 def _create_pixmap_from_svg(self, svg_path, size): """Create a pixmap from SVG with proper scaling and dark mode support.""" From df49f80cdfed1e099625ca7f6121bacf0052142c Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 31 May 2026 11:08:53 +0200 Subject: [PATCH 137/210] MNT: Move "backend" from a regular rcParams dict entry to a class attribute Working towards #31791. > rcParams should be only configuration, not state; i.e. wrt. backend, it > can hold the desired backend and backend priorities, but it should not > hold the currently active backend or trigger backend selection as a > side-effect. The latter causes a lot of complexity in rcParams. This PR is the first step in the migration strategy outlined there: > Make the backend a RcParams class attribute and do not hold > "backend" as a regular dict entry. There can only be one backend, > so putting that value in a class attribute `RcParams._backend` makes > sense. This already reduces the complexity as we don't need special > handling to sync/copy the value when rcParams are bulk-replaced > (loading from file or rc_context). Instead add special logic to keep > behavioral backward compatibility with the dict API > (`rcParams["backend"]` / `rcParams._get("backend")` / > `"rcParams._set("backend", val)`). Note on API compatibility: This PR limits itself to the known typical dict-API usages in the context of backend handling. I've refrained from trying to fully replicate dict behavior of a "virtual" "backend" parameter, i.e. `len(rcParams)` / `rcParams.keys()` / `rcParams.values()` / `rcParams.items()` do not contain "backend" anymore. I would be willing to accept this level of API breakage. If deemed critical, we could add compatibility shims for that too. --- lib/matplotlib/__init__.py | 58 ++++++++++++++++----------- lib/matplotlib/__init__.pyi | 1 - lib/matplotlib/tests/test_rcparams.py | 8 +++- lib/matplotlib/tests/test_typing.py | 9 +++++ 4 files changed, 50 insertions(+), 26 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 2a83cc1f1091..3ecad4599b34 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -693,6 +693,12 @@ class RcParams(MutableMapping, dict): validate = rcsetup._validators + # Class-level backend state: shared across all RcParams instances because + # there can only be one active backend at a time. + # rcParams["backend"] remains valid API for now, but stores the values here + # and not as regular key in the underlying dict. + _backend = rcsetup._auto_backend_sentinel + # validate values on the way in def __init__(self, *args, **kwargs): self.update(*args, **kwargs) @@ -715,6 +721,9 @@ def _set(self, key, val): :meta public: """ + if key == "backend": + RcParams._backend = val + return dict.__setitem__(self, key, val) def _get(self, key): @@ -736,6 +745,8 @@ def _get(self, key): :meta public: """ + if key == "backend": + return RcParams._backend return dict.__getitem__(self, key) def _update_raw(self, other_params): @@ -753,24 +764,24 @@ def _update_raw(self, other_params): """ if isinstance(other_params, RcParams): other_params = dict.items(other_params) + else: + if "backend" in other_params: + # should not happen because we aim to not use "backend" as a regular + # key anymore, but keep to ensure we have not overlooked a code path. + raise RuntimeError("'backend' must not be passed to _update_raw()") dict.update(self, other_params) - def _ensure_has_backend(self): - """ - Ensure that a "backend" entry exists. - - Normally, the default matplotlibrc file contains *no* entry for "backend" (the - corresponding line starts with ##, not #; we fill in _auto_backend_sentinel - in that case. However, packagers can set a different default backend - (resulting in a normal `#backend: foo` line) in which case we should *not* - fill in _auto_backend_sentinel. - """ - dict.setdefault(self, "backend", rcsetup._auto_backend_sentinel) - def __setitem__(self, key, val): - if (key == "backend" - and val is rcsetup._auto_backend_sentinel - and "backend" in self): + if (key == "backend" and val is rcsetup._auto_backend_sentinel): + # Don't let caller silently overwrite a real backend with the auto-sentinel + # (only internal code via _set() may do that). + # + # The primary reason for existence was covering internal rcParams logic + # since end-users do not have direct access to + # rcsetup._auto_backend_sentinel. It is likely that this is not needed + # anymore due to removing "backend" from the dict and making it + # a class attribute RcParams._backend`. But to be on the safe side, we + # keep this as long as "backend" is a valid key for rcParams. return valid_key = _api.getitem_checked( self.validate, rcParam=key, _error_cls=KeyError @@ -784,18 +795,19 @@ def __setitem__(self, key, val): self._set(key, cval) def __getitem__(self, key): - # In theory, this should only ever be used after the global rcParams - # has been set up, but better be safe e.g. in presence of breakpoints. - if key == "backend" and self is globals().get("rcParams"): - val = self._get(key) - if val is rcsetup._auto_backend_sentinel: + if key == "backend": + # In theory, this should only ever be used after the global rcParams + # has been set up, but better be safe e.g. in presence of breakpoints. + if (self is globals().get("rcParams") + and RcParams._backend is rcsetup._auto_backend_sentinel): from matplotlib import pyplot as plt plt.switch_backend(rcsetup._auto_backend_sentinel) + return RcParams._backend return self._get(key) def _get_backend_or_none(self): """Get the requested backend, if any, without triggering resolution.""" - backend = self._get("backend") + backend = RcParams._backend return None if backend is rcsetup._auto_backend_sentinel else backend def __repr__(self): @@ -992,7 +1004,6 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True): transform=lambda line: line[1:] if line.startswith("#") else line, fail_on_error=True) rcParamsDefault._update_raw(rcsetup._hardcoded_defaults) -rcParamsDefault._ensure_has_backend() rcParams = RcParams() # The global instance. rcParams._update_raw(rcParamsDefault) @@ -1201,8 +1212,7 @@ def rc_context(rc=None, fname=None): plt.plot(x, y) """ - orig = dict(rcParams.copy()) - del orig['backend'] + orig = rcParams.copy() try: if fname: rc_file(fname) diff --git a/lib/matplotlib/__init__.pyi b/lib/matplotlib/__init__.pyi index 47c9784068fb..fdf70b5aed4b 100644 --- a/lib/matplotlib/__init__.pyi +++ b/lib/matplotlib/__init__.pyi @@ -77,7 +77,6 @@ class RcParams(dict[RcKeyType, Any]): def _update_raw(self, other_params: dict[RcKeyType, Any] | RcParams) -> None: ... - def _ensure_has_backend(self) -> None: ... def __setitem__(self, key: RcKeyType, val: Any) -> None: ... def __getitem__(self, key: RcKeyType) -> Any: ... def __iter__(self) -> Generator[RcKeyType, None, None]: ... diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py index fb1b2730e93e..ecfa222785a3 100644 --- a/lib/matplotlib/tests/test_rcparams.py +++ b/lib/matplotlib/tests/test_rcparams.py @@ -681,7 +681,13 @@ def test_rc_aliases(group, option, alias, value): def test_all_params_defined_as_code(): - assert set(p.name for p in rcsetup._params_list()) == set(mpl.rcParams.keys()) + params_in_code = {p.name for p in rcsetup._params_list()} + # 'backend' is stored in RcParams._backend (a class variable) rather than + # in the underlying dict, so it does not appear in rcParams.keys() / + # __iter__. It is still accessible via rcParams['backend'] and + # 'backend' in rcParams; it just doesn't show up during iteration. + params_in_code.remove("backend") + assert params_in_code == set(mpl.rcParams.keys()) def test_validators_defined_as_code(): diff --git a/lib/matplotlib/tests/test_typing.py b/lib/matplotlib/tests/test_typing.py index 5d219f91ffa9..902592bcee42 100644 --- a/lib/matplotlib/tests/test_typing.py +++ b/lib/matplotlib/tests/test_typing.py @@ -103,6 +103,15 @@ def test_rcparam_stubs(): if not name.startswith('_') } + # backend is not a regular dict key anymore, but we have special logic to ensure + # read and write access to it. + # The _get('backend') is just a smoke test that 'backend' is still supported, and + # it is thus justified to add 'backend' to the keys. This will fail in the future + # when we remove 'backend' as accepted key and will remind us that we have to + # remove it from the stubs. + plt.rcParamsDefault._get('backend') # smoke test + runtime_rc_keys.add('backend') + assert isinstance(RcKeyType, typing.TypeAliasType) assert {*typing.get_args(RcKeyType.__value__)} == runtime_rc_keys From 376cc99dbbcb278d2cbf7b546cda86c9ede2364a Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:21:25 +0200 Subject: [PATCH 138/210] DOC: Improve figure rcParams descriptions (#32457) --- lib/matplotlib/pyplot.py | 9 +++-- lib/matplotlib/rcsetup.py | 79 ++++++++++++++++++++++++++------------- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index d02eea7281a0..62bf7e9c8d16 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1019,10 +1019,11 @@ def figure( method or the `new_figure_manager` function provided by the current backend, which install a canvas and a manager on the figure. - Once this is done, :rc:`figure.hooks` are called, one at a time, on the - figure; these hooks allow arbitrary customization of the figure (e.g., - attaching callbacks) or of associated elements (e.g., modifying the - toolbar). See :doc:`/gallery/user_interfaces/mplcvd` for an example of + Once this is done, figure hooks are called in the order listed in + :rc:`figure.hooks`. Figure hooks are functions of the form + ``def hook(fig: Figure) -> None`` and can modify the created figure + (e.g. attach callbacks) or associated figure elements (e.g., update the + toolbar). See :doc:`/gallery/user_interfaces/mplcvd` for an example of toolbar customization. If you are creating many figures, make sure you explicitly call diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 688483a350f3..96249c94ee09 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1567,68 +1567,72 @@ class _Subsection: default="large", type=_FontSizeType, validator=validate_fontsize, - description="size of the figure title (``Figure.suptitle()``)" + description="Size of the figure title (see `.Figure.suptitle`)." ), _Param( "figure.titleweight", default="normal", type=_FontWeightType, validator=validate_fontweight, - description="weight of the figure title" + description="Weight of the figure title (see `.Figure.suptitle`)." ), _Param( "figure.labelsize", default="large", type=_FontSizeType, validator=validate_fontsize, - description="size of the figure label (``Figure.sup[x|y]label()``)" + description="Size of the figure label (see `.Figure.supxlabel` / " + "`.Figure.supylabel`)." ), _Param( "figure.labelweight", default="normal", type=_FontWeightType, validator=validate_fontweight, - description="weight of the figure label" + description="Weight of the figure label (see `.Figure.supxlabel` / " + "`.Figure.supylabel`)." ), _Param( "figure.figsize", default=[6.4, 4.8], type=tuple[float, float], validator=_listify_validator(validate_float, n=2), - description="figure size in inches" + description="Figure size as (width, height) in inches." ), _Param( "figure.dpi", default=100.0, type=float, - validator=validate_float, description="figure dots per inch" + validator=validate_float, + description="Figure resolution in dpi (dots per inch)." ), _Param( "figure.facecolor", default="white", type=":mpltype:`color`", - validator=validate_color, description="figure face color" + validator=validate_color, description="Color of the figure background." ), _Param( "figure.edgecolor", default="white", type=":mpltype:`color`", - validator=validate_color, description="figure edge color" + validator=validate_color, description="Edge color of the figure background." ), _Param( "figure.frameon", default=True, type=bool, - validator=validate_bool, description="enable figure frame" + validator=validate_bool, + description="Whether to draw the figure background patch." ), _Param( "figure.max_open_warning", default=20, type=int, validator=validate_int, - description="The maximum number of figures to open through the pyplot " - "interface before emitting a warning. If less than one this " - "feature is disabled." + description="Maximum number of figures to open through the pyplot interface " + "before emitting a warning. If less than one, this feature is " + "disabled." ), _Param( "figure.raise_window", @@ -1645,60 +1649,72 @@ class _Subsection: default=0.125, type=float, validator=validate_float, - description="the left side of the subplots of the figure" + description="Position of the left edge of the subplots, as a fraction of " + "the figure width. See `.SubplotParams`." ), _Param( "figure.subplot.right", default=0.9, type=float, validator=validate_float, - description="the right side of the subplots of the figure" + description="Position of the right edge of the subplots, as a fraction of " + "the figure width. See `.SubplotParams`." ), _Param( "figure.subplot.bottom", default=0.11, type=float, validator=validate_float, - description="the bottom of the subplots of the figure" + description="Position of the bottom edge of the subplots, as a fraction of " + "the figure height. See `.SubplotParams`." ), _Param( "figure.subplot.top", default=0.88, type=float, validator=validate_float, - description="the top of the subplots of the figure" + description="Position of the top edge of the subplots, as a fraction of " + "the figure height. See `.SubplotParams`." ), _Param( "figure.subplot.wspace", default=0.2, type=float, validator=validate_float, - description="the amount of width reserved for space between subplots, " - "expressed as a fraction of the average axis width" + description="Width of the padding between subplots, as a fraction of the " + "average Axes width. See `.SubplotParams`." ), _Param( "figure.subplot.hspace", default=0.2, type=float, validator=validate_float, - description="the amount of height reserved for space between subplots, " - "expressed as a fraction of the average axis height" + description="Height of the padding between subplots, as a fraction of the " + "average Axes height. See `.SubplotParams`." ), _Param( "figure.autolayout", default=False, type=bool, validator=validate_bool, - description="When True, automatically adjust subplot parameters to make the " - "plot fit the figure using `~.Figure.tight_layout`" + description="Whether to use the tight layout mechanism to adapt subplot " + "parameters. See the parameter *tight_layout* of `.Figure` for " + "more information." + "\n\n" + "Note: Only one of the parameters 'figure.autolayout' and " + "'figure.constrained_layout.use' can be True at a time." ), _Param( "figure.constrained_layout.use", default=False, type=bool, validator=validate_bool, - description="When True, automatically make plot elements fit on the figure. " - '(Not compatible with "figure.autolayout", above).' + description="Whether to use the constrained layout mechanism to optimize " + "figure layout. See the parameter *constrained_layout* of " + "`.Figure` for more information." + "\n\n" + "Note: Only one of the parameters 'figure.autolayout' and " + "'figure.constrained_layout.use' can be True at a time." ), _Param( "figure.constrained_layout.h_pad", @@ -1706,7 +1722,7 @@ class _Subsection: type=float, validator=validate_float, description="Padding (in inches) around axes; defaults to 3/72 inches, " - "i.e. 3 points" + "i.e. 3 points." ), _Param( "figure.constrained_layout.w_pad", @@ -1714,7 +1730,7 @@ class _Subsection: type=float, validator=validate_float, description="Padding (in inches) around axes; defaults to 3/72 inches, " - "i.e. 3 points" + "i.e. 3 points." ), _Param( "figure.constrained_layout.hspace", @@ -1741,7 +1757,16 @@ class _Subsection: default=[], type=list[str], validator=validate_stringlist, - description="list of dotted.module.name:dotted.callable.name" + description="List of functions that are called after figure creation. " + "These can be used to customize the created figure. The " + "functions are declared as fully qualified names, e.g. " + "'dotted.module.name:function_name'. Each function must have the " + "signature ``function(fig: Figure) -> None``." + "\n\n" + "This is a `.pyplot` feature and is only executed on figures that " + "are created via pyplot functions. See also the note in " + "`.pyplot.figure`. Figure hooks do not apply to figures " + "created through ``Figure()``." ), _Section("Axes"), _Param( From b6734e9732ed253db92d2b81e0b8f8551bd00fa2 Mon Sep 17 00:00:00 2001 From: maaz7409 Date: Fri, 16 Oct 2026 14:16:08 +0000 Subject: [PATCH 139/210] BLD: Install the type stub for backends.registry --- lib/matplotlib/backends/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/backends/meson.build b/lib/matplotlib/backends/meson.build index 1e3e47c0a915..fd7503bbfdb8 100644 --- a/lib/matplotlib/backends/meson.build +++ b/lib/matplotlib/backends/meson.build @@ -41,6 +41,8 @@ typing_sources = [ '_backend_agg.pyi', '_macosx.pyi', '_tkagg.pyi', + # Pure Python types. + 'registry.pyi', ] py3.install_sources(python_sources, typing_sources, From 27a1c1e8cb159872a1ef6e0ddecf6220c4a1f037 Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Fri, 16 Oct 2026 09:40:44 -0700 Subject: [PATCH 140/210] Add mpl::format and cleanup mplutils --- src/_backend_agg.h | 6 ++-- src/_backend_agg_wrapper.cpp | 4 +-- src/_image_wrapper.cpp | 59 +++++++++++++++++------------------ src/_qhull_wrapper.cpp | 12 +++----- src/_tkagg.cpp | 14 +++++---- src/ft2font.cpp | 21 ++++++------- src/ft2font_wrapper.cpp | 6 ++-- src/mplutils.h | 60 +++++++++++++++++++++--------------- src/path_converters.h | 2 +- 9 files changed, 95 insertions(+), 89 deletions(-) diff --git a/src/_backend_agg.h b/src/_backend_agg.h index 3130ba289701..322f5d453d05 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -410,7 +410,7 @@ RendererAgg::_draw_path(path_t &path, bool has_clippath, const std::optional RendererAgg::text_clip_rect(const agg::rect_d return std::nullopt; } agg::rect_i clip; - clip.init(mpl_round_to_int(cliprect.x1), mpl_round_to_int(height - cliprect.y2), - mpl_round_to_int(cliprect.x2), mpl_round_to_int(height - cliprect.y1)); + clip.init(mpl::round_to_int(cliprect.x1), mpl::round_to_int(height - cliprect.y2), + mpl::round_to_int(cliprect.x2), mpl::round_to_int(height - cliprect.y1)); return clip; } diff --git a/src/_backend_agg_wrapper.cpp b/src/_backend_agg_wrapper.cpp index 4d225a1c5772..ad4e34a927a8 100644 --- a/src/_backend_agg_wrapper.cpp +++ b/src/_backend_agg_wrapper.cpp @@ -129,8 +129,8 @@ PyRendererAgg_draw_image(RendererAgg *self, // TODO: This really shouldn't be mutable, but Agg's renderer buffers aren't const. auto image = image_obj.mutable_unchecked<3>(); - x = mpl_round(x); - y = mpl_round(y); + x = mpl::round(x); + y = mpl::round(y); self->draw_image(gc, x, y, image); } diff --git a/src/_image_wrapper.cpp b/src/_image_wrapper.cpp index d7edf6b93c08..2c3602841c16 100644 --- a/src/_image_wrapper.cpp +++ b/src/_image_wrapper.cpp @@ -85,16 +85,16 @@ _get_transform_mesh(const py::object& transform, const py::ssize_t *dims) py::array_t(output_mesh); if (output_mesh_array.ndim() != 2) { - throw std::runtime_error( - "Inverse transformed mesh array should be 2D not {}D"_s.format( + throw std::runtime_error(mpl::format( + "Inverse transformed mesh array should be 2D not {}D", output_mesh_array.ndim())); } // An undersized mesh would be read out of bounds by the resampler. if (output_mesh_array.shape(0) != mesh_dims[0] || output_mesh_array.shape(1) != mesh_dims[1]) { - throw std::runtime_error( - "Inverse transformed mesh array should have shape ({}, {}) not ({}, {})"_s.format( + throw std::runtime_error(mpl::format( + "Inverse transformed mesh array should have shape ({}, {}) not ({}, {})", mesh_dims[0], mesh_dims[1], output_mesh_array.shape(0), output_mesh_array.shape(1))); } @@ -124,8 +124,8 @@ image_resample(py::array input_array, } if (ndim == 3 && input_array.shape(2) != 4) { - throw std::invalid_argument( - "3D input array must be RGBA with shape (M, N, 4), has trailing dimension of {}"_s.format( + throw std::invalid_argument(mpl::format( + "3D input array must be RGBA with shape (M, N, 4), has trailing dimension of {}", input_array.shape(2))); } @@ -139,14 +139,14 @@ image_resample(py::array input_array, auto out_ndim = output_array.ndim(); if (out_ndim != ndim) { - throw std::invalid_argument( - "Input ({}D) and output ({}D) arrays have different dimensionalities"_s.format( + throw std::invalid_argument(mpl::format( + "Input ({}D) and output ({}D) arrays have different dimensionalities", ndim, out_ndim)); } if (out_ndim == 3 && output_array.shape(2) != 4) { - throw std::invalid_argument( - "3D output array must be RGBA with shape (M, N, 4), has trailing dimension of {}"_s.format( + throw std::invalid_argument(mpl::format( + "3D output array must be RGBA with shape (M, N, 4), has trailing dimension of {}", output_array.shape(2))); } @@ -220,6 +220,16 @@ image_resample(py::array input_array, } +[[noreturn]] static void +raise_image_comparison_failure(std::string msg) +{ + auto exceptions = py::module_::import("matplotlib.testing.exceptions"); + auto ImageComparisonFailure = exceptions.attr("ImageComparisonFailure"); + py::set_error(ImageComparisonFailure.ptr(), msg.c_str()); + throw py::error_already_set(); +} + + // This is used by matplotlib.testing.compare to calculate RMS and a difference image. static py::tuple calculate_rms_and_diff(py::array_t expected_image, @@ -229,13 +239,9 @@ calculate_rms_and_diff(py::array_t expected_image, std::pair{actual_image, "Actual"}}) { if (image.ndim() != 3) { - auto exceptions = py::module_::import("matplotlib.testing.exceptions"); - auto ImageComparisonFailure = exceptions.attr("ImageComparisonFailure"); - py::set_error( - ImageComparisonFailure, - "{name} image must be 3-dimensional, but is {ndim}-dimensional"_s.format( - "name"_a=name, "ndim"_a=image.ndim())); - throw py::error_already_set(); + raise_image_comparison_failure(mpl::format( + "{} image must be 3-dimensional, but is {}-dimensional", + name, image.ndim())); } } @@ -244,25 +250,16 @@ calculate_rms_and_diff(py::array_t expected_image, auto depth = expected_image.shape(2); if (depth != 3 && depth != 4) { - auto exceptions = py::module_::import("matplotlib.testing.exceptions"); - auto ImageComparisonFailure = exceptions.attr("ImageComparisonFailure"); - py::set_error( - ImageComparisonFailure, - "Image must be RGB or RGBA but has depth {depth}"_s.format( - "depth"_a=depth)); - throw py::error_already_set(); + raise_image_comparison_failure(mpl::format( + "Image must be RGB or RGBA but has depth {}", depth)); } if (height != actual_image.shape(0) || width != actual_image.shape(1) || depth != actual_image.shape(2)) { - auto exceptions = py::module_::import("matplotlib.testing.exceptions"); - auto ImageComparisonFailure = exceptions.attr("ImageComparisonFailure"); - py::set_error( - ImageComparisonFailure, - "Image sizes do not match expected size: {expected_image.shape} "_s - "actual size {actual_image.shape}"_s.format( + raise_image_comparison_failure(mpl::format( + "Image sizes do not match expected size: {expected_image.shape} " + "actual size {actual_image.shape}", "expected_image"_a=expected_image, "actual_image"_a=actual_image)); - throw py::error_already_set(); } auto expected = expected_image.unchecked<3>(); auto actual = actual_image.unchecked<3>(); diff --git a/src/_qhull_wrapper.cpp b/src/_qhull_wrapper.cpp index 49632843fc53..8f22df268f37 100644 --- a/src/_qhull_wrapper.cpp +++ b/src/_qhull_wrapper.cpp @@ -20,6 +20,7 @@ extern const char qh_version[]; } #endif +#include "mplutils.h" #include "libqhull_r/qhull_ra.h" #include #include @@ -195,13 +196,10 @@ delaunay_impl(py::ssize_t npoints, const double* x, const double* y, exitcode = qh_new_qhull(qh, ndim, (int)npoints, points.data(), False, (char*)"qhull d Qt Qbb Qc Qz", nullptr, error_file); if (exitcode != qh_ERRnone) { - std::string msg = - py::str("Error in qhull Delaunay triangulation calculation: {} (exitcode={})") - .format(qhull_error_msg[exitcode], exitcode).cast(); - if (hide_qhull_errors) { - msg += "; use python verbose option (-v) to see original qhull error."; - } - throw std::runtime_error(msg); + throw std::runtime_error(mpl::format( + "Error in qhull Delaunay triangulation calculation: {} (exitcode={}){}", + qhull_error_msg[exitcode], exitcode, hide_qhull_errors ? + "; use python verbose option (-v) to see original qhull error." : "")); } /* Split facets so that they only have 3 points each. */ diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index 955ce2103f90..3924020cd247 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -31,6 +31,8 @@ #include #include +#include "mplutils.h" + namespace py = pybind11; using namespace pybind11::literals; @@ -108,18 +110,18 @@ mpl_tk_blit(py::object interp_obj, const char *photo_name, auto data_ptr = data.mutable_unchecked<3>(); // Checks ndim and writeable flag. if (data.shape(2) != 4) { - throw py::value_error( - "Data pointer must be RGBA; last dimension is {}, not 4"_s.format( + throw py::value_error(mpl::format( + "Data pointer must be RGBA; last dimension is {}, not 4", data.shape(2))); } if (data.shape(0) > INT_MAX) { // Limited by Tk_PhotoPutBlock argument type. - throw std::range_error( - "Height ({}) exceeds maximum allowable size ({})"_s.format( + throw std::range_error(mpl::format( + "Height ({}) exceeds maximum allowable size ({})", data.shape(0), INT_MAX)); } if (data.shape(1) > INT_MAX / 4) { // Limited by Tk_PhotoImageBlock.pitch field. - throw std::range_error( - "Width ({}) exceeds maximum allowable size ({})"_s.format( + throw std::range_error(mpl::format( + "Width ({}) exceeds maximum allowable size ({})", data.shape(1), INT_MAX / 4)); } const auto height = static_cast(data.shape(0)); diff --git a/src/ft2font.cpp b/src/ft2font.cpp index 8f9a8585dc93..373d6b7ad351 100644 --- a/src/ft2font.cpp +++ b/src/ft2font.cpp @@ -359,17 +359,17 @@ std::vector FT2Font::layout( if (features) { for (auto const& feature : *features) { if (!raqm_add_font_feature(rq, feature.c_str(), feature.size())) { - throw std::runtime_error("failed to set font feature {}"_s.format(feature)); + throw std::runtime_error(mpl::format( + "failed to set font feature {}", feature)); } } } if (languages) { for (auto & [lang_str, start, end] : *languages) { if (!raqm_set_language(rq, lang_str.c_str(), start, end - start)) { - throw std::runtime_error( - "failed to set language between {} and {} characters "_s - "to {!r} for layout"_s.format( - start, end, lang_str)); + throw std::runtime_error(mpl::format( + "failed to set language between {} and {} characters " + "to {!r} for layout", start, end, lang_str)); } } } @@ -439,18 +439,17 @@ std::vector FT2Font::layout( if (features) { for (auto const& feature : *features) { if (!raqm_add_font_feature(rq, feature.c_str(), feature.size())) { - throw std::runtime_error( - "failed to set font feature {}"_s.format(feature)); + throw std::runtime_error(mpl::format( + "failed to set font feature {}", feature)); } } } if (languages) { for (auto & [lang_str, start, end] : *languages) { if (!raqm_set_language(rq, lang_str.c_str(), start, end - start)) { - throw std::runtime_error( - "failed to set language between {} and {} characters "_s - "to {!r} for layout"_s.format( - start, end, lang_str)); + throw std::runtime_error(mpl::format( + "failed to set language between {} and {} characters " + "to {!r} for layout", start, end, lang_str)); } } } diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index df0f967e413e..48a0a3f44f48 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -1660,9 +1660,9 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used()) "The kerning between this item and the previous one.") .def("__str__", [](const LayoutItem& item) { - return - "LayoutItem(ft_object={}, char={!r}, glyph_index={}, "_s - "x={}, y={}, prev_kern={})"_s.format( + return py::str( + "LayoutItem(ft_object={}, char={!r}, glyph_index={}, " + "x={}, y={}, prev_kern={})").format( PyFT2Font_fname(item.ft_object), item.character, item.glyph_index, item.x, item.y, item.prev_kern); }); diff --git a/src/mplutils.h b/src/mplutils.h index 37135174e200..e846874c7dc7 100644 --- a/src/mplutils.h +++ b/src/mplutils.h @@ -27,16 +27,15 @@ #endif #endif +#include +#include +#include +#include +#include -inline int mpl_round_to_int(double v) -{ - return (int)(v + ((v >= 0.0) ? 0.5 : -0.5)); -} +namespace py = pybind11; +using namespace pybind11::literals; -inline double mpl_round(double v) -{ - return (double)mpl_round_to_int(v); -} // 'kind' codes for paths. enum { @@ -48,14 +47,27 @@ enum { CLOSEPOLY = 0x4f }; -#ifdef __cplusplus // not for macosx.m -#include -#include -#include -#include -namespace py = pybind11; -using namespace pybind11::literals; +namespace mpl { + +inline int round_to_int(double v) +{ + return (int)(v + ((v >= 0.0) ? 0.5 : -0.5)); +} + +inline double round(double v) +{ + return (double)round_to_int(v); +} + +template +inline std::string format(const char *fmt, Args &&...args) +{ + return std::string(py::str(fmt).format(std::forward(args)...)); +} + +} // namespace mpl + // Helper for std::visit. template struct overloaded : Ts... { using Ts::operator()...; }; @@ -67,8 +79,8 @@ template inline void check_trailing_shape(T array, char const* name, long d1) { if (array.ndim() != 2) { - throw py::value_error( - "Expected 2-dimensional array, got {}"_s.format(array.ndim())); + throw py::value_error(mpl::format( + "Expected 2-dimensional array, got {}", array.ndim())); } if (array.size() == 0) { // Sometimes things come through as atleast_2d, etc., but they're empty, so @@ -76,8 +88,8 @@ inline void check_trailing_shape(T array, char const* name, long d1) return; } if (array.shape(1) != d1) { - throw py::value_error( - "{} must have shape (N, {}), got ({}, {})"_s.format( + throw py::value_error(mpl::format( + "{} must have shape (N, {}), got ({}, {})", name, d1, array.shape(0), array.shape(1))); } } @@ -86,8 +98,8 @@ template inline void check_trailing_shape(T array, char const* name, long d1, long d2) { if (array.ndim() != 3) { - throw py::value_error( - "Expected 3-dimensional array, got {}"_s.format(array.ndim())); + throw py::value_error(mpl::format( + "Expected 3-dimensional array, got {}", array.ndim())); } if (array.size() == 0) { // Sometimes things come through as atleast_3d, etc., but they're empty, so @@ -95,8 +107,8 @@ inline void check_trailing_shape(T array, char const* name, long d1, long d2) return; } if (array.shape(1) != d1 || array.shape(2) != d2) { - throw py::value_error( - "{} must have shape (N, {}, {}), got ({}, {}, {})"_s.format( + throw py::value_error(mpl::format( + "{} must have shape (N, {}, {}), got ({}, {}, {})", name, d1, d2, array.shape(0), array.shape(1), array.shape(2))); } } @@ -127,5 +139,3 @@ safe_first_shape(const std::array &) } #endif - -#endif diff --git a/src/path_converters.h b/src/path_converters.h index 2a1f4ca6fe70..e25c9650b838 100644 --- a/src/path_converters.h +++ b/src/path_converters.h @@ -629,7 +629,7 @@ class PathSnapper m_snap = should_snap(source, snap_mode, total_vertices); if (m_snap) { - int is_odd = mpl_round_to_int(stroke_width) % 2; + int is_odd = mpl::round_to_int(stroke_width) % 2; m_snap_value = (is_odd) ? 0.5 : 0.0; } From dc9df6a7d17d94cebac7e0e6c857728e6d4db86a Mon Sep 17 00:00:00 2001 From: Ricci Adams Date: Fri, 16 Oct 2026 11:03:36 -0700 Subject: [PATCH 141/210] Fix indentation based on review (plus a bonus tab-to-space fix) --- src/_image_wrapper.cpp | 20 ++++++++++---------- src/_tkagg.cpp | 7 +++---- src/mplutils.h | 4 ++-- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/_image_wrapper.cpp b/src/_image_wrapper.cpp index 2c3602841c16..4abdff531721 100644 --- a/src/_image_wrapper.cpp +++ b/src/_image_wrapper.cpp @@ -73,7 +73,7 @@ _get_transform_mesh(const py::object& transform, const py::ssize_t *dims) for (auto y = 0; y < dims[0]; ++y) { for (auto x = 0; x < dims[1]; ++x) { // The convention for the supplied transform is that pixel centers - // are at 0.5, 1.5, 2.5, etc. + // are at 0.5, 1.5, 2.5, etc. *p++ = (double)x + 0.5; *p++ = (double)y + 0.5; } @@ -87,7 +87,7 @@ _get_transform_mesh(const py::object& transform, const py::ssize_t *dims) if (output_mesh_array.ndim() != 2) { throw std::runtime_error(mpl::format( "Inverse transformed mesh array should be 2D not {}D", - output_mesh_array.ndim())); + output_mesh_array.ndim())); } // An undersized mesh would be read out of bounds by the resampler. @@ -95,8 +95,8 @@ _get_transform_mesh(const py::object& transform, const py::ssize_t *dims) output_mesh_array.shape(1) != mesh_dims[1]) { throw std::runtime_error(mpl::format( "Inverse transformed mesh array should have shape ({}, {}) not ({}, {})", - mesh_dims[0], mesh_dims[1], - output_mesh_array.shape(0), output_mesh_array.shape(1))); + mesh_dims[0], mesh_dims[1], + output_mesh_array.shape(0), output_mesh_array.shape(1))); } return output_mesh_array; @@ -126,7 +126,7 @@ image_resample(py::array input_array, if (ndim == 3 && input_array.shape(2) != 4) { throw std::invalid_argument(mpl::format( "3D input array must be RGBA with shape (M, N, 4), has trailing dimension of {}", - input_array.shape(2))); + input_array.shape(2))); } // Ensure input array is contiguous, regardless of dtype @@ -141,13 +141,13 @@ image_resample(py::array input_array, if (out_ndim != ndim) { throw std::invalid_argument(mpl::format( "Input ({}D) and output ({}D) arrays have different dimensionalities", - ndim, out_ndim)); + ndim, out_ndim)); } if (out_ndim == 3 && output_array.shape(2) != 4) { throw std::invalid_argument(mpl::format( "3D output array must be RGBA with shape (M, N, 4), has trailing dimension of {}", - output_array.shape(2))); + output_array.shape(2))); } if (!output_array.dtype().is(dtype)) { @@ -225,7 +225,7 @@ raise_image_comparison_failure(std::string msg) { auto exceptions = py::module_::import("matplotlib.testing.exceptions"); auto ImageComparisonFailure = exceptions.attr("ImageComparisonFailure"); - py::set_error(ImageComparisonFailure.ptr(), msg.c_str()); + py::set_error(ImageComparisonFailure, msg.c_str()); throw py::error_already_set(); } @@ -241,7 +241,7 @@ calculate_rms_and_diff(py::array_t expected_image, if (image.ndim() != 3) { raise_image_comparison_failure(mpl::format( "{} image must be 3-dimensional, but is {}-dimensional", - name, image.ndim())); + name, image.ndim())); } } @@ -259,7 +259,7 @@ calculate_rms_and_diff(py::array_t expected_image, raise_image_comparison_failure(mpl::format( "Image sizes do not match expected size: {expected_image.shape} " "actual size {actual_image.shape}", - "expected_image"_a=expected_image, "actual_image"_a=actual_image)); + "expected_image"_a=expected_image, "actual_image"_a=actual_image)); } auto expected = expected_image.unchecked<3>(); auto actual = actual_image.unchecked<3>(); diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index 3924020cd247..a28710ce03ff 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -111,18 +111,17 @@ mpl_tk_blit(py::object interp_obj, const char *photo_name, auto data_ptr = data.mutable_unchecked<3>(); // Checks ndim and writeable flag. if (data.shape(2) != 4) { throw py::value_error(mpl::format( - "Data pointer must be RGBA; last dimension is {}, not 4", - data.shape(2))); + "Data pointer must be RGBA; last dimension is {}, not 4", data.shape(2))); } if (data.shape(0) > INT_MAX) { // Limited by Tk_PhotoPutBlock argument type. throw std::range_error(mpl::format( "Height ({}) exceeds maximum allowable size ({})", - data.shape(0), INT_MAX)); + data.shape(0), INT_MAX)); } if (data.shape(1) > INT_MAX / 4) { // Limited by Tk_PhotoImageBlock.pitch field. throw std::range_error(mpl::format( "Width ({}) exceeds maximum allowable size ({})", - data.shape(1), INT_MAX / 4)); + data.shape(1), INT_MAX / 4)); } const auto height = static_cast(data.shape(0)); const auto width = static_cast(data.shape(1)); diff --git a/src/mplutils.h b/src/mplutils.h index e846874c7dc7..4848e31db09e 100644 --- a/src/mplutils.h +++ b/src/mplutils.h @@ -90,7 +90,7 @@ inline void check_trailing_shape(T array, char const* name, long d1) if (array.shape(1) != d1) { throw py::value_error(mpl::format( "{} must have shape (N, {}), got ({}, {})", - name, d1, array.shape(0), array.shape(1))); + name, d1, array.shape(0), array.shape(1))); } } @@ -109,7 +109,7 @@ inline void check_trailing_shape(T array, char const* name, long d1, long d2) if (array.shape(1) != d1 || array.shape(2) != d2) { throw py::value_error(mpl::format( "{} must have shape (N, {}, {}), got ({}, {}, {})", - name, d1, d2, array.shape(0), array.shape(1), array.shape(2))); + name, d1, d2, array.shape(0), array.shape(1), array.shape(2))); } } From aae4b352d19f3f90d8fce4b577c4c5bd74e5fa59 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 16 Oct 2026 14:46:37 -0400 Subject: [PATCH 142/210] DOC: add comment in tests Co-authored-by: Albert Y. Shih --- lib/matplotlib/tests/test_backend_svg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py index 6c388dff9982..850138e6bff8 100644 --- a/lib/matplotlib/tests/test_backend_svg.py +++ b/lib/matplotlib/tests/test_backend_svg.py @@ -223,6 +223,7 @@ def test_rasterized_zorder_axes_hierarchy(): axes_parents = {} + # Recurses the SVG hierarchy to find any Axes parent for each Axes def walk(elem, axes_ancestor=None): gid = elem.get('id') if elem.tag == 'g' else None next_ancestor = axes_ancestor From 8a554252b152ac567bac418afba427e7ba91ba36 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 16 Oct 2026 14:49:52 -0400 Subject: [PATCH 143/210] STY: fix indent --- lib/matplotlib/tests/test_backend_svg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py index 850138e6bff8..db89b698159a 100644 --- a/lib/matplotlib/tests/test_backend_svg.py +++ b/lib/matplotlib/tests/test_backend_svg.py @@ -223,7 +223,7 @@ def test_rasterized_zorder_axes_hierarchy(): axes_parents = {} - # Recurses the SVG hierarchy to find any Axes parent for each Axes + # Recurses the SVG hierarchy to find any Axes parent for each Axes def walk(elem, axes_ancestor=None): gid = elem.get('id') if elem.tag == 'g' else None next_ancestor = axes_ancestor From e3c68d5000c1b1c59645c141a588f7dae40aa8bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:16:02 +0000 Subject: [PATCH 144/210] Bump the actions group with 6 updates Bumps the actions group with 6 updates: | Package | From | To | | --- | --- | --- | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.1` | `7.0.2` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.1` | `8.0.2` | | [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) | `4.2.1` | `4.3.0` | | [github/codeql-action/init](https://github.com/github/codeql-action) | `4.38.2` | `4.38.3` | | [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.38.2` | `4.38.3` | | [j178/prek-action](https://github.com/j178/prek-action) | `3.0.0` | `3.0.1` | Updates `actions/upload-artifact` from 7.0.1 to 7.0.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9) Updates `actions/download-artifact` from 8.0.1 to 8.0.2 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333) Updates `pypa/cibuildwheel` from 4.2.1 to 4.3.0 - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/e090b81e30c4d855ea63bf4b6e59204c09a101ae...adba99c781d3746d38b3a09b1cf797965bcb7fe6) Updates `github/codeql-action/init` from 4.38.2 to 4.38.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...24c54180a607b1449ed407dd24f251e4e9147c8d) Updates `github/codeql-action/analyze` from 4.38.2 to 4.38.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...24c54180a607b1449ed407dd24f251e4e9147c8d) Updates `j178/prek-action` from 3.0.0 to 3.0.1 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](https://github.com/j178/prek-action/compare/4e14d07f9231acabce116ccfca13b13dd9755ece...1382ad72dea72f9d53832f2bcb65b3e87a947204) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: pypa/cibuildwheel dependency-version: 4.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action/init dependency-version: 4.38.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/codeql-action/analyze dependency-version: 4.38.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: j178/prek-action dependency-version: 3.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/cibuildwheel.yml | 12 ++++++------ .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/linting.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- .github/workflows/wasm.yml | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 350364c60e03..1b522d49c0d5 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -73,7 +73,7 @@ jobs: run: twine check dist/* - name: Upload sdist result - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: cibw-sdist path: dist/*.tar.gz @@ -115,7 +115,7 @@ jobs: steps: - name: Download sdist - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: cibw-sdist path: dist/ @@ -125,7 +125,7 @@ jobs: run: Remove-Item -Recurse C:\Strawberry - name: Build wheels for CPython 3.14 - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 + uses: pypa/cibuildwheel@adba99c781d3746d38b3a09b1cf797965bcb7fe6 # v4.3.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -133,7 +133,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.13 - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 + uses: pypa/cibuildwheel@adba99c781d3746d38b3a09b1cf797965bcb7fe6 # v4.3.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -141,14 +141,14 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.12 - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 + uses: pypa/cibuildwheel@adba99c781d3746d38b3a09b1cf797965bcb7fe6 # v4.3.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: CIBW_BUILD: "cp312-*" CIBW_ARCHS: ${{ matrix.cibw_archs }} - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: cibw-wheels-${{ runner.os }}-${{ matrix.cibw_archs }} path: ./wheelhouse/*.whl diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1263d5a25250..9a8dfd783c69 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 + uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 with: languages: ${{ matrix.language }} @@ -45,4 +45,4 @@ jobs: pip install --user -v . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 + uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 4c45d9012208..8ff26071ba08 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -15,11 +15,11 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0 + - uses: j178/prek-action@1382ad72dea72f9d53832f2bcb65b3e87a947204 # v3.0.1 with: extra-args: --hook-stage manual --all-files --skip oxipng # Only run oxipng on the last diff, because we haven't updated all images. - - uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0 + - uses: j178/prek-action@1382ad72dea72f9d53832f2bcb65b3e87a947204 # v3.0.1 with: extra-args: --hook-stage manual --from-ref origin/${{ github.base_ref }} oxipng diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 47f3b415dde5..0aab3d5724b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -386,7 +386,7 @@ jobs: - name: Upload macOS crash logs if: failure() && runner.os == 'macOS' - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: macos-crash-logs path: ~/Library/Logs/DiagnosticReports/* @@ -398,7 +398,7 @@ jobs: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}" token: ${{ secrets.CODECOV_TOKEN }} - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: failure() with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images" diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 547348c1456a..03247b02d837 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -45,13 +45,13 @@ jobs: persist-credentials: false - name: Build wheels for wasm - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 + uses: pypa/cibuildwheel@adba99c781d3746d38b3a09b1cf797965bcb7fe6 # v4.3.0 env: CIBW_SKIP: "cp315-*" CIBW_PLATFORM: "pyodide" CIBW_TEST_COMMAND: "true" - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: cibw-wheels-wasm path: ./wheelhouse/*.whl From 06dc2b64e8f181279eadca1617d468d3d1572481 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 16 Oct 2026 15:21:07 -0400 Subject: [PATCH 145/210] MNT: no reason to reach for __new__ in tests Co-authored-by: Elliott Sales de Andrade --- lib/matplotlib/tests/test_animation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_animation.py b/lib/matplotlib/tests/test_animation.py index 0fef17e6c44b..255a095823ab 100644 --- a/lib/matplotlib/tests/test_animation.py +++ b/lib/matplotlib/tests/test_animation.py @@ -140,7 +140,10 @@ def test_movie_writer_args_not_implemented(): # must *raise* NotImplementedError rather than merely returning it, so a # subclass that forgets to override it fails loudly instead of passing an # exception instance on as if it were the command-line arguments. - writer = animation.MovieWriter.__new__(animation.MovieWriter) + class IncorrectMovieWriter(animation.MovieWriter): + pass + + writer = IncorrectMovieWriter() with pytest.raises(NotImplementedError, match="args needs to be implemented by subclass"): writer._args() From 95fab38471eb029be5bad5a64fb15c5169f2f548 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 16 Apr 2026 14:55:10 -0400 Subject: [PATCH 146/210] Make Animation._repr_html_ more useful by default While `Animation` does define `_repr_html_`, it does nothing by default since `animation.html` is 'none'. The 'html5' option is the best, but it requires FFmpeg to be installed. So introduce a new 'auto' option that picks either one depending on what's available, and make it the default. --- .../next_whats_new/animation_default.rst | 7 ++++++ .../users_explain/animations/animations.py | 3 +++ lib/matplotlib/animation.py | 24 +++++++++++++------ lib/matplotlib/mpl-data/matplotlibrc | 9 +++---- lib/matplotlib/rcsetup.py | 17 ++++++------- lib/matplotlib/tests/test_animation.py | 16 +++++++++++++ 6 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 doc/release/next_whats_new/animation_default.rst diff --git a/doc/release/next_whats_new/animation_default.rst b/doc/release/next_whats_new/animation_default.rst new file mode 100644 index 000000000000..4c0821675eb0 --- /dev/null +++ b/doc/release/next_whats_new/animation_default.rst @@ -0,0 +1,7 @@ +Animations now default to video rich display in Jupyter notebooks +----------------------------------------------------------------- + +When rich display of an Animation object is requested (i.e., by placing the variable as +the last line in a notebook cell), it will now default to the best available video +output. That is, if FFmpeg is available, a video file will be output, otherwise a +JavaScript animation will be output. diff --git a/galleries/users_explain/animations/animations.py b/galleries/users_explain/animations/animations.py index 45c42f538fa6..444018676093 100644 --- a/galleries/users_explain/animations/animations.py +++ b/galleries/users_explain/animations/animations.py @@ -64,6 +64,9 @@ # - `.Animation.to_jshtml` to create HTML code with interactive JavaScript animation # controls # - `.Animation.save` to save the animation to a file +# - Place the animation as the last statement in a Jupyter Notebook cell; this will +# automatically render the animation as video and display it as the cell output, +# unless :rc:`animation.html` is set to ``'none'``. # # The following table shows a few plotting methods, the artists they return and some # commonly used ``set_*`` methods that update the underlying data. While updating data diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index b29885646a56..406d46cbed17 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -1276,7 +1276,7 @@ def _end_redraw(self, event): self._resize_id = self._fig.canvas.mpl_connect('resize_event', self._on_resize) - def to_html5_video(self, embed_limit=None): + def to_html5_video(self, embed_limit=None, *, _writer_cls=None): """ Convert the animation to an HTML5 ``