Weekly GitHub Report for Matplotlib: March 10, 2025 - March 17, 2025
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 respecting array alpha in image interpolation, removing md5 usage for FIPS compliance, and fixing various plotting and figure handling bugs, alongside 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]: memory baking figure is not freed when figure is closed: This issue reports a memory leak in Matplotlib versions 3.9.1 and later, where memory usage increases linearly when figures are closed, due to a reference to the figure object being retained in a global state. The problem does not occur in version 3.8.4, and while adding
fig.clf()
afterplt.show()
reduces the memory leak, it does not completely resolve it.- The comments discuss potential solutions, such as using
plt.close(fig)
, but this does not resolve the issue. The problem is reproducible with theqtagg
backend but not withtkagg
, and it occurs on both Linux and Windows. Suggestions include running the GUI event loop to clean up C++ objects, but memory usage still increases, indicating further investigation is needed. - Number of comments this week: 10
- The comments discuss potential solutions, such as using
-
[ENH]: ConnectionPatch's connection line arrow size and position issue: This issue involves a user attempting to create a global traffic flow map using matplotlib, specifically facing challenges with controlling the size and position of arrows in ConnectionPatch lines to ensure they are not covered by the circle and remain consistent in size. The user seeks advice on setting parameters to maintain a consistent arrow size or position them in the middle of the connecting line, as current attempts using available parameters have not yielded the desired results.
- The comments discuss various solutions, including using
head_width
andmutation_scale
to adjust arrow size, providing a complete code example for better assistance, and suggesting the use ofshrinkA
andshrinkB
parameters. There is also a discussion about the feasibility of making scatter points extractable for better arrow positioning, with suggestions to plot each point individually or use padding logic to adjust arrow positions. The user acknowledges the advice and plans to try the suggested methods. - Number of comments this week: 8
- The comments discuss various solutions, including using
-
[Bug]: Unit tests: MacOS 14 failures: gi-invoke-error-quark: This issue reports a bug encountered during unit tests on MacOS 14, where the error "gi-invoke-error-quark" occurs due to the failure to locate the dynamic library file
libglib-2.0.0.dylib
, affecting Python versions 3.12 and 3.13. The problem seems to be linked to a recent dependency version upgrade inPyGObject
, and a temporary workaround involves pinning thePyGObject
version to below 3.52.0 to allow tests to pass.- The comments discuss the missing
libglib-2.0.0.dylib
file, suggesting it should be provided by theglib
Homebrew package, and explore the possibility that a recentPyGObject
version upgrade is causing the issue. A pull request successfully resolves the problem by pinningPyGObject
to a version below 3.52.0, but there is uncertainty about why other platforms are unaffected. The issue is reopened to track the problem and potentially report a bug to GNOME'spygobject
project. - Number of comments this week: 7
- The comments discuss the missing
-
[Bug]: Matplotlib savefig and close break multiprocessing and numpy thread allocation: This issue describes a bug that occurs when using Matplotlib's
savefig
andclose
functions in conjunction with multiprocessing and NumPy, leading to a significant slowdown in execution time and reduced CPU thread utilization. The problem appears to be specific to certain versions of Python and Matplotlib, and is influenced by the method of multiprocessing pool generation, as well as the source of the Python and Matplotlib installations.- The comments discuss attempts to reproduce the bug, with suggestions to modify the code and use different backends, but the issue persists. It is noted that the bug does not occur with Matplotlib installed from conda-forge or PyPI, but does occur with the default Anaconda channel, suggesting a build-specific issue. The discussion also touches on differences in compiler versions used for building Python, but this is deemed unlikely to be the cause.
- Number of comments this week: 6
-
[MNT]: Upcoming version of
pyparsing
will start emittingDeprecationWarnings
for legacy pre-PEP8 method and argument names: This issue addresses the upcoming changes in thepyparsing
library, where the new version 3.3.0 will start emittingDeprecationWarnings
for legacy method and argument names that do not conform to PEP8 standards, with plans to remove these synonyms entirely in version 4.0.0. The issue also proposes a fix by introducing a scanner/converter script to help users transition their code to the new naming conventions, ensuring compatibility with future versions ofpyparsing
.- The comments discuss the successful execution of the auto-conversion script with minimal changes needed and the plan to upgrade the minimum supported
pyparsing
version. They also highlight the discovery of non-PEP8 attributes onParserElement
that will be addressed in future updates, and the need to consider Python version dependencies when upgradingpyparsing
. - Number of comments this week: 2
- The comments discuss the successful execution of the auto-conversion script with minimal changes needed and the plan to upgrade the minimum supported
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.
- [Doc]: Release docs include Next what's new pages: This issue pertains to the inclusion of a "Next what's new" page in the release documentation of a project, which ideally should not be present in the documentation for official releases. The problem highlights a need for improvement in the documentation process to ensure that only relevant and finalized content is included in release versions.
- [ENH]: out-of-tree Pyodide builds in CI for Matplotlib: This issue is about implementing out-of-tree Pyodide builds for Matplotlib using the Emscripten toolchain to create wasm32 wheels, which would enhance the interoperability of the Scientific Python ecosystem with Pyodide and facilitate interactive documentation in JupyterLite notebooks. The proposed solution involves setting up a CI pipeline on GitHub Actions to build and test the development version of Matplotlib against a Pyodide wasm32 runtime, addressing any test failures due to current Pyodide limitations.
- [Bug]: constrained layout clips y-label above y-axis: This issue describes a bug in the Matplotlib library where the y-label is clipped when positioned above the y-axis using constrained layout, although it displays correctly with tight layout or when placed on the left side. The problem persists across different plot configurations, including single and multiple plots, and the user has attempted various solutions such as adjusting vertical alignments and layout padding without success.
- [Bug]: Matplotlib date2num timezone removal issue: This issue pertains to a bug in the Matplotlib library's
date2num
function, where a problem arises when handling lists containing both timezone-aware datetime objects and plain date objects. The function only checks the timezone information of the first element in the list, leading to an error when subsequent elements are plain dates, as they lack theastimezone
method required for conversion. - [Bug]: Exported PDF figures cannot be modified by Adobe Illustrator correctly.: This issue describes a bug where figures generated using the
imshow
function in Matplotlib and saved as PDF files are not displayed correctly when opened in Adobe Illustrator, with colors being incorrectly assigned. The problem persists despite using the specified code and environment, and it affects users who rely on Adobe Illustrator for further editing of their Matplotlib-generated figures.
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: 11
Summarized Issues:
- Matplotlib Performance Issues: The
cursor
class in Matplotlib experiences performance issues when redrawing the canvas as the mouse moves out of the axis, suggesting improvements usingblit
. Additionally, usingsavefig
andclose
functions in scripts with multiprocessing and NumPy leads to reduced CPU utilization and increased execution time, indicating potential library interaction problems.
- Matplotlib Build and Environment Setup Problems: Setting up a development environment for Matplotlib can fail due to missing build system requirements like "ninja", and building from source on macOS can encounter issues with locating Pybind11 headers. These problems highlight the need for specific build dependencies and proper environment configuration.
- Matplotlib Memory and Data Handling Bugs: A memory leak in Matplotlib versions 3.9.1 and later causes memory usage to increase when figures are closed, with partial mitigation available. Additionally, modifying arrays from
get_data
affects future calls but not the plot, suggesting a need for data handling improvements.
- Matplotlib Documentation and Installation Updates: The installation instructions for Matplotlib need updates to include new package managers like uv and pixi, though there is some hesitation regarding uv due to existing issues. This reflects the evolving landscape of package management and the need for current documentation.
- Matplotlib GitHub Actions and Dependency Issues: Unit tests on MacOS 14 fail due to a missing
libglib-2.0.0.dylib
library, linked to a PyGObject upgrade, causing errors. Similarly, tests on Ubuntu 22.04 fail due to missing dependencies from the PyGObject package, requiring systemglib
upgrades.
- Matplotlib Feature and Usability Challenges: Creating a global traffic flow map using ConnectionPatch in Matplotlib presents challenges in controlling arrow size and position, requiring parameter adjustments and code modifications for consistency. This highlights the need for improved usability in complex plotting scenarios.
- Pyparsing Deprecation and Compatibility: The upcoming release of pyparsing version 3.2.2 will be the last to accept both PEP8 and non-PEP8 names without warnings, with future versions emitting
DeprecationWarnings
and eventually removing legacy names. This necessitates codebase updates for compatibility, affecting projects like matplotlib.
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: 5
Summarized Issues:
- Matplotlib Version Compatibility Issues: Updating Matplotlib from version 3.8.3 to 3.10.0 causes failures in LXC containers due to the TkAgg backend being selected, which is incompatible with the 'headless' environment, leading to ImportError exceptions. Additionally, a bug in version 3.10 causes a crash when using a tuple-type linestyle with a histogram due to a
ValueError
, which did not occur in version 3.9, related to handling inhomogeneous shapes in arrays.
- Matplotlib Geographic Plotting Bug: A bug with the
inset_axes()
function in Matplotlib when used with CartoPy for geographic plotting results in aValueError
, indicating that the axes should be an instance ofGeoAxes
. Despite verifying the types, users encounter this error, and the problem is expected to be resolved in a future version of Matplotlib.
- Matplotlib Documentation Tag Duplication: The Matplotlib documentation contains duplicate tags, which are confusing due to separate "component" and "styling" categories. This setup results in users encountering less informative tags first due to alphabetical ordering, and improvements are suggested to consolidate these tags for better navigation.
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: 9
Key Open Pull Requests
1. Use PEP8 style method and function names from pyparsing: This pull request updates the Matplotlib project to use PEP8 style method and function names from the pyparsing library, prepares for the pyparsing 3.3.0 release by bumping the minimum required version to 3.0, and includes several commits for cleaning up code and adding API notes.
- URL: pull/29745
- Merged: No
2. WebAgg based jupyter notebook backend: This pull request introduces a new WebAgg-based backend for Jupyter notebooks, designed to fully support the interactive features of EOmaps by using an ipywidgets
HTML widget to embed the generated WebAgg page within the notebook, allowing for proper blitting without lags or glitches, and seeks feedback on whether this implementation should be integrated into Matplotlib or remain within EOmaps.
- URL: pull/29725
- Merged: No
3. DOC: Explain how to start the mainloop after show(block=False): This pull request aims to enhance the documentation by explaining how to initiate the mainloop after using the show(block=False)
function in Matplotlib, as indicated by the commit message and the absence of additional details in the body.
- URL: pull/29742
- Merged: No
- Associated Commits: 68cad
Other Open Pull Requests
- Backporting Changes for Version Pinning and Case Sensitivity Fixes: The pull requests focus on backporting changes to different branches of the Matplotlib project. They address version pinning of PyGObject in macOS tests and fix case sensitivity issues in backend detection, ensuring compatibility and stability across versions.
- Documentation Enhancements and Installation Instructions: These pull requests enhance the Matplotlib documentation by adding installation instructions for 'pixi' and 'uv' packages and discussing the use of 'pyside6' for GUI framework installation. They also aim to improve the linkage of tags like "fun" in examples, addressing previous limitations in documentation.
- Annotation Arrow Style and Visual Enhancements: The pull request simplifies the annotation arrow style reference by using data coordinates instead of Axes coordinates. This change makes the code easier to follow and enhances the visual contrast of annotations by adjusting the point marker and textbox edge to dark grey.
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: 19
Key Closed Pull Requests
1. merge up v3.10.1: This pull request involves merging updates and backports for version 3.10.1 of the Matplotlib project, including various documentation improvements, bug fixes such as handling of figure modifications and title positions in polar plots, and adjustments to dependencies and test cases, as well as addressing issues like removing md5 usage for FIPS compliance and respecting array alpha in image processing.
- URL: pull/29700
- Merged: 2025-03-12T16:49:46Z
- Associated Commits: fa0c3, 9f74b, f82e4, d4238, 94692, c3dc3, 18354, 84598, 40012, 73a28, af136, b9e62, f4763, 1d915, 4b399, 41a7e, 4f3d4, d3cf5, 9fe0d, d23b1, 52678, 2495b, 33361, 6fc81, 14d07, d94f8
2. ci: MacOS 14: temporarily upper-bound the 'PyGObject' Python package version: This pull request addresses a compatibility issue in GitHub Actions for MacOS 14 by temporarily setting an upper limit on the 'PyGObject' Python package version to prevent test failures, as versions v3.52.0 and beyond were causing problems, and it includes several commits to refine the continuous integration process, such as applying the version constraint only on affected platforms.
- URL: pull/29734
- Merged: 2025-03-12T12:01:26Z
3. Add ninja to Python build requirements: This pull request aims to add "ninja" to the Python build requirements for the Matplotlib project, addressing a build issue on macOS and optimizing the continuous integration (CI) process by centralizing the installation of "ninja" to avoid using system package managers.
- URL: pull/29740
- Merged: No
Other Closed Pull Requests
- Case-Sensitivity Bug in Backend Autodetection: This topic addresses a bug in the
matplotlib.pyplot
module where the interactive environment valueTkAgg
was not recognized as equivalent totkagg
. The fix ensures proper backend auto-configuration, which was previously functional in version 3.8.3, and includes tests for backend fallback in headless mode.
- Handling of Singleton Sequence-Type Styles in
hist
Function: The pull requests under this topic correct the handling of singleton sequence-type styles in thehist
function by replacingnp.atleast_1d
withto_rgba_array
for color properties. The changes ensure proper testing and are backported to maintain consistency across versions.
- Type Hint Correction in
SubplotSpec.get_gridspec
Method: This topic involves correcting the type hint in theSubplotSpec.get_gridspec
method to return aGridSpecBase
instance. The correction aligns with the type accepted by theSubplotSpec.__init__
method and is backported to ensure consistency.
- Hatch Style Reference Tag Addition: These pull requests add a reference tag to the Hatch style reference in the Matplotlib project, enhancing documentation to aid users in finding examples. The changes are backported to different branches to maintain documentation consistency.
- PyGObject Version Pinning for MacOS: This topic addresses the temporary setting of an upper limit on the version of the 'PyGObject' Python package for compatibility with MacOS 14. The changes are backported to ensure consistent testing environments across branches.
- Documentation Enhancements: This topic includes enhancing the description of the "What's new" entry and consolidating documentation tags to improve clarity and organization. These changes address specific issues and improve the overall user experience with the documentation.
- Dependency Policy Update and Reversion: The pull requests under this topic involve updating the dependency policy link from NEP 29 to SPEC 0 and subsequently reverting the change due to inconsistencies. The reversion highlights the need for a more comprehensive proposal and discussion.
- Color Tags Consolidation: This topic consolidates color tags in the Matplotlib project by adding a colormap tag to a scatter example. The changes address issue #29753 and improve the project's documentation and example clarity.
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 | 44 | 7 | 4 | 48 |
rcomer | 12 | 5 | 2 | 17 |
story645 | 5 | 0 | 1 | 23 |
anntzer | 4 | 1 | 2 | 21 |
tacaswell | 9 | 1 | 0 | 16 |
jklymak | 2 | 0 | 0 | 21 |
dstansby | 11 | 6 | 3 | 3 |
jayaddison | 6 | 2 | 2 | 13 |
star1327p | 17 | 0 | 0 | 0 |
No author found | 16 | 0 | 0 | 0 |