Weekly GitHub Report for Matplotlib: April 14, 2025 - April 21, 2025 (12:00:47)
Weekly GitHub Report for Matplotlib
Thank you for subscribing to our weekly newsletter! Each week, we deliver a comprehensive summary of your GitHub project's latest activity right to your inbox, including an overview of your project's issues, pull requests, contributors, and commit activity.
Table of Contents
I. News
1.1 Recent Version Releases:
The current version of this repository is v3.10.1
1.2 Version Information:
Released on February 27, 2025, this first bugfix update for the 3.10.x series addresses several issues, including improvements in image handling, security enhancements by removing md5 usage, and fixes for plot handling and positioning. Additionally, it introduces a version gate for GTK4 calls and raises warnings for specific scatter plot configurations, alongside various documentation enhancements.
II. Issues
2.1 Top 5 Active Issues:
We consider active issues to be issues that that have been commented on most frequently within the last week. Bot comments are omitted.
-
[Bug]: axes.prop_cycle behavior change: This issue highlights a change in the behavior of the
axes.prop_cycle
in Matplotlib, where the color cycle has shifted from a list of strings representing hex color codes to a list of tuples representing RGB values. This change has caused a problem for MNE-Python, which relied on the previous behavior, leading to aValueError
when attempting to remove a specific color from the list.- The comments discuss the unsafety of relying on hex notation and suggest using
matplotlib.colors.to_hex()
ormatplotlib.colors.same_color
as potential fixes. There is a mention of the lack of a deprecation pathway for changing default rcParams, and a user expresses surprise at the change fromlist[str]
tolist[tuple[float, float, float]]
. The discussion also touches on the technical aspect of the color type beinglist[matplotlib.typing.ColorType]
, though this is not formalized. - Number of comments this week: 6
- The comments discuss the unsafety of relying on hex notation and suggest using
-
[Bug]: findfont: Font family '' not found. despite being present and queriable via fontconfig; never makes it to ~/.cache/matplotlib/fontlist-v330.json either: This issue describes a bug where the user is unable to use the 'MathJax_Math-Italic' font in Matplotlib, despite the font being installed and queriable via fontconfig, and it does not appear in the Matplotlib font cache. The user provides a detailed reproduction script and notes that other fonts from the same directory are recognized, but the 'MathJax_Math-Italic' font consistently results in a "font not found" error.
- The comments suggest clearing the Matplotlib font cache, checking font installation, and manually specifying the font path. It is noted that Matplotlib does not support WOFF fonts, and the current FreeType version does not support WOFF2, though there is ongoing work to update FreeType. The user confirms that the font manager only supports certain font types and that the suggested workaround does not resolve the issue, with mplcairo being unavailable on their system.
- Number of comments this week: 3
-
[Bug]: AttributeError: module 'matplotlib' has no attribute 'backend_bases': This issue describes a bug encountered after upgrading from matplotlib version 3.8 to 3.9, where the user receives an
AttributeError
indicating that the module 'matplotlib' has no attribute 'backend_bases' when attempting to use the 'side' attribute in violin plots. The user is seeking a solution to this error and also expresses a desire to set different colors for each side of the violin plot, which they currently cannot do.- The comments suggest that the user's environment might be broken, and a reinstallation or a fresh environment is recommended. The user acknowledges that reverting to version 3.8 resolves the issue but limits functionality, and they express concern that the problem might be specific to their environment. A suggestion is made to try running the script in a new conda environment to potentially resolve the issue.
- Number of comments this week: 3
-
[Bug]: Disconnecting shared axis: This issue is about a bug in the Matplotlib library where the user is unable to make tick labels reappear after isolating axes that were previously shared, despite the ranges being correctly set and the view being rescaled. The user is seeking guidance on how to achieve the desired effect of making the axes labels visible again after unsharing, particularly for use in geoplots where shared axes are initially beneficial.
- The comments section includes a brief interaction with a contributor, discussing the issue of isolating axes and the challenges faced in making tick labels reappear after unsharing them.
- Number of comments this week: 1
Since there were fewer than 5 open issues, all of the open issues have been listed above.
2.2 Top 5 Stale Issues:
We consider stale issues to be issues that has had no activity within the last 30 days. The team should work together to get these issues resolved and closed as soon as possible.
- [Bug]: Misalignment of Labels and Incorrect Density Values in
ax.hist()
for Categorical Variables: This issue highlights a bug in theax.hist()
function of Matplotlib when used with categorical variables and thedensity=True
parameter, leading to incorrect density computations because the function converts categorical variables to integers, which affects the bin width and results in miscalculated density values. Additionally, the issue points out the misalignment of labels, as the function does not position labels at the center of the bars, and suggests improvements such as setting the bin width to 1 for categorical data and providing clear documentation on the category-to-integer conversion process. - [MNT]: Ease building just one Sphinx Gallery example file: This issue addresses the challenge of efficiently building a single Sphinx Gallery example file, which currently requires a lengthy process through
make html
ormake html-skip-subdirs
, often resulting in numerous unhelpful warnings. The proposed solution involves updating the documentation to provide clearer guidance on building individual files and potentially adding a new build target in the Makefile to streamline the process, thereby making it more accessible for developers, especially beginners, who need to frequently preview their work. - [ENH]: Parse "\limits" in mathtext: This issue pertains to a problem encountered in the matplotlib library's mathtext module, where the parsing of LaTeX expressions containing the "\limits" command fails, resulting in a ValueError. The "\limits" command is intended to adjust the positioning of subscripts and superscripts for certain mathematical operators, such as integrals, but currently leads to a parsing error when used, as demonstrated by the provided code and error message.
- [ENH]: Fix precision displayed by LogFormatter.format_data_short: This issue addresses the need to enhance the LogFormatter in a GitHub project by ensuring it displays mouse cursor values with a precision that matches the cursor pointing accuracy, similar to the existing functionality for linear formatters. The problem has been open for over a year, indicating a desire for consistency in how data precision is presented across different types of formatters within the project.
- [Bug]:
ax.transData
does not honor data limits: This issue highlights a bug in Matplotlib where theax.transData
transformation does not automatically update to reflect changes in data limits (xlim
andylim
) when new data is added to the axes, contrary to what the documentation suggests. The user reports that this discrepancy requires a manual update of the data limits using methods likeset_xlim
andset_ylim
to ensureax.transData
uses the latest data limits, which is both confusing and not aligned with the expected behavior as per the documentation.
2.3 Open Issues
This section lists, groups, and then summarizes issues that were created within the last week in the repository.
Issues Opened This Week: 7
Summarized Issues:
- Font Recognition Issues in Matplotlib: The font family 'MathJax_Math-Italic' is not recognized by Matplotlib despite being installed and detectable via fontconfig. This results in repeated errors when attempting to use the font in plots, as it does not appear in the font cache file.
- Color Cycle Configuration Changes: The
matplotlib
library'saxes.prop_cycle
configuration has changed from a list of hexadecimal color strings to RGB tuples. This shift causes compatibility problems for users relying on the previous format, such as the MNE-Python project, which encounters errors when removing specific colors by their hex values.
- AttributeError in Matplotlib 3.9: After upgrading from matplotlib version 3.8 to 3.9, users receive an
AttributeError
indicating that the module 'matplotlib' has no attribute 'backend_bases'. This error occurs when creating violin plots with the 'side' attribute, suggesting a potential conflict or misconfiguration in the user's environment.
- Default Rotation Mode for Tick Labels: A proposal suggests making "xtick" the default rotation mode for tick labels in Matplotlib. This change is argued to provide superior alignment, although it may be a minor breaking change for some users.
- Blitting Example in Documentation: The blitting minimal example in the Matplotlib documentation does not display correctly due to the absence of a draw_event callback. Adding this callback is suggested to improve the example and documentation.
- Tick Labels on Shared Axes: Users face issues with making tick labels reappear on axes in Matplotlib after isolating them from shared axes. The current functionality does not support this, resulting in hidden tick labels despite correct rescaling of the axes.
2.4 Closed Issues
This section lists, groups, and then summarizes issues that were closed within the last week in the repository. This section also links the associated pull requests if applicable.
Issues Closed This Week: 8
Summarized Issues:
- Matplotlib LaTeX Rendering Issues: A bug in Matplotlib causes the right parenthesis in certain LaTeX expressions to be replaced with an exclamation mark when using the 'cm' fontset, specifically when both the upper and lower bounds of an integral are set. This issue does not affect other mathematical symbols like (\sum) or (\iint).
- Matplotlib Layout and Rendering Bugs: Matplotlib has a bug where using
plt.ticklabel_format(style='plain')
causes the y-axis label to be rendered out of view, with a suggested solution to use the 'Constrained Layout' feature. Additionally, contour plots using the Mollweide projection do not render correctly, resulting in a ValueError when attempting to reshape an array, which worked in earlier versions.
- Matplotlib Script and Type Hint Issues: The
boilerplate.py
script in Matplotlib removes parameters when run in a different branch without user changes, raising questions about the script or installation environment. There is also a need to update type hints for extent coordinates to accept any real number, proposing the use ofnumbers.Real
for type annotations.
- Matplotlib Colorbar and Plot Enhancement Requests: Adding a colorbar using the axes divider method resizes the original image, suggesting a separate axis for the colorbar to avoid this. An enhancement request for
plt.colorbar()
suggests matching the colorbar's dimensions to the original image rather than the figure size.
- Matplotlib QR Code Feature Proposal: A proposal for Matplotlib to generate a QR code linking to an SVG plot was closed, with a suggestion to document how to add QR codes using existing capabilities without new dependencies.
2.5 Issue Discussion Insights
This section will analyze the tone and sentiment of discussions within this project's open and closed issues that occurred within the past week. It aims to identify potentially heated exchanges and to maintain a constructive project environment.
Based on our analysis, there are no instances of toxic discussions in the project's open or closed issues from the past week.
III. Pull Requests
3.1 Open Pull Requests
This section provides a summary of pull requests that were opened in the repository over the past week. The top three pull requests with the highest number of commits are highlighted as 'key' pull requests. Other pull requests are grouped based on similar characteristics for easier analysis. Up to 25 pull requests are displayed in this section, while any remaining pull requests beyond this limit are omitted for brevity.
Pull Requests Opened This Week: 8
Key Open Pull Requests
1. Backport PR #29931 on branch v3.10.x (Allow Python native sequences in Matplotlib imsave()
.): This pull request is a backport of PR #29931 to the v3.10.x branch of the Matplotlib project, aiming to enhance the imsave()
function by allowing it to accept Python native sequences, and includes commits for both the main feature and code style improvements.
- URL: pull/29933
- Merged: No
2. Fix auto-sized glyphs with BaKoMa fonts: This pull request addresses a bug in the Matplotlib project by fixing the incorrect mapping of larger glyphs for auto-sized characters in the cmex10
font when using BaKoMa fonts, ensuring that these glyphs are correctly mapped through the latex_to_bakoma
table using their glyph names as commands to prevent double-mapping to the wrong font, and resolving several specific issues such as incorrect glyphs being used for slashes, parentheses, braces, floors, and ceilings at larger sizes.
- URL: pull/29936
- Merged: No
3. Parse {lua,xe}tex-generated dvi in dviread.: This pull request introduces parsing capabilities for DVI files generated by LuaTeX and XeTeX in the dviread module, enabling the representation of system-wide TrueType (OpenType) fonts and their metrics, as part of ongoing efforts to support these TeX engines as alternative usetex engines.
- URL: pull/29939
- Merged: No
Other Open Pull Requests
- Documentation Enhancements: This topic focuses on improving the Matplotlib library's documentation. One pull request aims to enhance the
matplotlib.typing
module by adding detailed descriptions to improve code readability and understanding for developers. Another pull request addresses a grammatical error in the user guide to improve clarity, changing "Autoscaling Axes" to "Axis Autoscaling" as recommended by a contributor.
- Image Optimization: A pull request proposes adding the oxipng tool to the pre-commit configuration with a specific compression level. This aims to enhance the image optimization process in the Matplotlib project without enabling metadata stripping or alpha channel optimization.
- Backporting Changes: This pull request involves backporting changes from a previous PR to the v3.10.x branch. It focuses on using text placeholders for empty legends in tests and has not yet been merged.
- Signal Handler Fix: A pull request addresses an issue with
cysignals
signal handlers being disrupted after callingplt.pause()
. The solution restores the OS-level signal handler, adapted from a similar fix in the python-prompt-toolkit project.
3.2 Closed Pull Requests
This section provides a summary of pull requests that were closed in the repository over the past week. The top three pull requests with the highest number of commits are highlighted as 'key' pull requests. Other pull requests are grouped based on similar characteristics for easier analysis. Up to 25 pull requests are displayed in this section, while any remaining pull requests beyond this limit are omitted for brevity.
Pull Requests Closed This Week: 20
Key Closed Pull Requests
1. API: bump minimum supported version of Python and numpy: This pull request updates the Matplotlib project by increasing the minimum supported versions of Python to 3.11 and NumPy to 1.25, while also documenting the necessary changes for version updates and addressing build and testing configurations, such as skipping wheel tests with PyPy and maintaining comments about using the oldest Windows image.
- URL: pull/29904
- Merged: 2025-04-18T19:34:37Z
2. Handle MOVETO's, CLOSEPOLY's and empty paths in Path.interpolated: This pull request addresses issue #29917 by enhancing the Path.interpolated
method in the Matplotlib library to handle internal MOVETO
commands by splitting and rejoining paths, manage CLOSEPOLY
commands, and bypass interpolation for empty paths, thereby resolving exceptions and improving the handling of geo projection path transformations.
- URL: pull/29919
- Merged: 2025-04-18T10:25:31Z
3. Doc fixed aspect colorbar: This pull request addresses issue #29938 by enhancing the documentation on colorbar placement and constrained layout in Matplotlib, specifically by adding information about the role of compressed layout in aligning colorbars with their parent axes, and simplifying the example to a single-axis scenario.
- URL: pull/29945
- Merged: 2025-04-18T18:00:12Z
Other Closed Pull Requests
- Integration of mpl-gui library: This pull request aims to integrate the standalone
mpl-gui
library into the main Matplotlib library. It seeks to simplify backend code and facilitate a transition away frompyplot
, although it currently lacks full functionality and documentation.
- Errorbar function bug fix: Two pull requests address a bug in the
errorbar
function of the Matplotlib library. They ensure that the function does not raise an exception when encountering masked negative errors by refining the error-checking logic and backporting these changes to the v3.10.x branch.
- Pre-commit hook updates: This pull request updates the pre-commit hook versions in the Matplotlib project. It replaces a previous pull request due to changes in the
flake8
tool and includes updates to most pre-commit versions and thecodespell
version.
- Type hint and docstring updates for set_prop_cycle: Two pull requests address the issue of type checkers erroneously flagging an error when
None
is passed toset_prop_cycle
. They update the type hints and addNone
to the function's docstring, with changes backported to the v3.10.x branch.
- Typographical error corrections: Two pull requests address typographical errors in the Matplotlib project. They correct the handling of the LaTeX command
\rightparen
and backport this fix to the v3.10.x branch.
- Enhancements to imsave() function: This pull request enhances the
imsave()
function in Matplotlib by enabling it to accept Python native sequences. It converts them intoNumPy
arrays during the image saving process, addressing issue #29183.
- Font metrics and legend labels: This pull request addresses the issue of font metrics affecting tests with empty legend labels. It uses text placeholders to ensure that even when legend labels are empty, they are not influenced by the line height calculated from the "lp" string.
- Type1 charmaps loading fix: This pull request addresses the issue of loading Type1 "native" charmaps by directly reading and returning the encoding vector via FreeType's Type1-specific API. It ensures proper decoding of DVI files in usetex mode.
- Correction of method signatures: This pull request addresses the correction of the signature for disabled draw methods in the Matplotlib project. It ensures future accuracy in method signatures, even though the change was deemed unnecessary for the backend signature in a previous related issue.
- Documentation build fixes: This pull request addresses the issue of failing documentation builds on the 3.10.x branch of the Matplotlib project. It incorporates changes from a previous pull request to fix broken links in the interactive guide.
- Re-enabling blank line checks: This pull request re-enables the check for blank line counts using the tool 'ruff' in the Matplotlib project. It was successfully merged on April 18, 2025.
- Safeguard in boilerplate.py script: This pull request addresses an issue in the
boilerplate.py
script by adding a safeguard to ensure that theAxes
andFigure
classes are imported from the correct source tree. It prevents discrepancies when the installed Matplotlib version differs from the source tree.
- Grammatical error correction in user guide: This pull request addresses a small grammatical error in the Matplotlib user guide. It changes the phrase "Autoscaling Axes" to "Autoscaling Axis" under the Axes & Subplots section.
3.3 Pull Request Discussion Insights
This section will analyze the tone and sentiment of discussions within this project's open and closed pull requests that occurred within the past week. It aims to identify potentially heated exchanges and to maintain a constructive project environment.
Based on our analysis, there are no instances of toxic discussions in the project's open or closed pull requests from the past week.
IV. Contributors
4.1 Contributors
Active Contributors:
We consider an active contributor in this project to be any contributor who has made at least 1 commit, opened at least 1 issue, created at least 1 pull request, or made more than 2 comments in the last month.
If there are more than 10 active contributors, the list is truncated to the top 10 based on contribution metrics for better clarity.
Contributor | Commits | Pull Requests | Issues | Comments |
---|---|---|---|---|
timhoffm | 19 | 2 | 8 | 45 |
jayaddison | 40 | 1 | 4 | 4 |
QuLogic | 19 | 8 | 0 | 19 |
anntzer | 13 | 4 | 1 | 22 |
rcomer | 6 | 2 | 2 | 23 |
jklymak | 7 | 2 | 3 | 15 |
tacaswell | 12 | 3 | 0 | 10 |
dstansby | 11 | 3 | 0 | 8 |
trygvrad | 4 | 2 | 0 | 11 |
oscargus | 2 | 0 | 0 | 8 |