Weekly GitHub Report for Matplotlib: March 11, 2025 - March 18, 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. It also introduces a version gate for GTK4 calls and enhances documentation.
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 describes a memory leak in Matplotlib versions 3.9.1 and later, where a reference to a figure object is retained in a global state, causing a linear increase in memory usage when figures are closed. 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 they have been unable to achieve the desired effect despite consulting available parameters.
- 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 alternative methods like plotting individual points or using padding to adjust arrow positions. The conversation also touches on the potential use ofshrinkA
andshrinkB
parameters, though the user finds them insufficient, and ultimately, the user plans to try logical controls for better arrow positioning. - 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 of a recentPyGObject
version upgrade causing the issue. A pull request successfully resolves the problem by pinningPyGObject
to a version below 3.52.0, although there is uncertainty about why other platforms are unaffected. The issue is reopened to track further investigation and potential reporting of a bug in thepygobject
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 reduction in CPU thread utilization and increased execution time. The problem is observed on Red Hat Enterprise Linux 9 with specific versions of Python and Matplotlib, and it appears to be related to how the multiprocessing pool is generated, particularly when using the fork method.- 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 when using Matplotlib from conda-forge, suggesting a potential issue with the Anaconda default channel's build. The discussion also explores differences in compiler versions and package sources, with some users able to reproduce the bug under specific conditions.
- 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 testing 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 version 3.3.0, and the need to update Python version dependencies, which will be documented in thepyparsing
CHANGES file. - Number of comments this week: 2
- The comments discuss the successful testing 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 these wheels, addressing any test failures due to current Pyodide limitations, and ensuring compatibility with the Pyodide wasm32 runtime environment.
- [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 placed above the y-axis/spine while using the constrained layout feature. The problem does not occur when using the tight layout or when the y-label is positioned on the side, indicating a specific issue with the constrained layout's handling of y-label positioning.
- [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
attribute, resulting in anAttributeError
. - [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 the visual integrity of the exported figures, making them unsuitable for professional use in Adobe Illustrator.
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: 8
Summarized Issues:
- Matplotlib Performance Issues on Red Hat Enterprise Linux 9: The use of Matplotlib's
savefig
andclose
functions in a Python script causes a significant reduction in CPU thread utilization during multiprocessing tasks. This leads to much slower execution times, and this behavior is observed on Red Hat Enterprise Linux 9 with specific versions of Python and Matplotlib, but not on other systems or configurations.
- Matplotlib ConnectionPatch Visualization Challenges: A user attempting to create a global traffic flow map using Matplotlib's ConnectionPatch encounters difficulties in controlling the size and position of the arrows on the connection lines. The arrows remain inconsistent and are obscured by the scatter plot circles, prompting the user to seek advice on parameter adjustments or alternative solutions.
- Matplotlib Build and Environment Setup Issues: Errors are encountered when setting up a development environment for Matplotlib using
uv
due to the absence of a required version of "ninja". Additionally, building Matplotlib from source on macOS fails because the C++ compiler cannot locate the Pybind11 headers, despite Pybind11 being installed.
- Matplotlib Memory Leak in Recent Versions: A memory leak is present in Matplotlib versions 3.9.1 and later, where closing figures does not free up memory as expected, leading to a linear increase in memory usage. The problem is not present in version 3.8.4, and potential workarounds like using
fig.clf()
orplt.close(fig)
only partially mitigate the issue.
- Matplotlib Documentation and Dependency Issues: There is a need to update the installation instructions in the Matplotlib documentation to include guidance on using the package management tools
uv
andpixi
. Additionally, unit tests on Ubuntu 22.04 fail due to missing dependencies required by the latest PyGObject version, specifically the absence ofgirepository-2.0
.
- Matplotlib Data Consistency Bug: Modifying the arrays returned by the
get_data
function affects future calls toget_data
but does not update the plot oncanvas.draw
. This leads to inconsistencies between the data and the visual representation, suggesting that eitherget_data
should return a copy of the data or the canvas should reflect changes to the artist's state.
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: 4
Summarized Issues:
- Matplotlib Version Update Bugs: Updating Matplotlib from version 3.8.3 to 3.10.0 has introduced a bug where the TkAgg backend is incorrectly selected in LXC containers, leading to an ImportError due to the absence of a graphical environment. Additionally, a bug in version 3.10 causes a crash when using a tuple-type linestyle with a histogram, which did not occur in version 3.9, and there is a related issue with handling tuple colors.
- Duplicate Tags in Matplotlib Documentation: The Matplotlib documentation contains duplicate tags for "color" and "colormap," which are confusing due to their separation into "component" and "styling" categories, leading users to encounter less informative tags first. There is a suggestion to consolidate these tags for better navigation by standardizing on specific formats, while noting that some tags like 'plot-style' may have been included accidentally.
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. 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 that address these changes, such as cleaning up code for pyparsing versions less than 3 and adding an API note.
- URL: pull/29745
- Merged: No
2. 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
3. Backport PR #29748 on branch v3.10.x (Fix PyGObject version pinning in macOS tests): This pull request addresses the backporting of changes from PR #29748 to the v3.10.x branch, specifically focusing on fixing the version pinning of PyGObject in macOS tests, as detailed in the commit with SHA d0ab4681ae5db8c971f1e1f3b4b27bc9834a3e32.
- URL: pull/29750
- Merged: No
- Associated Commits: d0ab4
Other Open Pull Requests
- Backporting Changes: This topic covers the backporting of changes to ensure compatibility and stability in different branches. One pull request focuses on fixing the version pinning of PyGObject in macOS tests, while another addresses a case-sensitivity issue in the auto-backend detection of pyplot.
- Documentation Enhancements: These pull requests aim to improve the documentation by adding installation instructions and expanding the use of tags. One request adds instructions for 'pixi' and 'uv' packages and suggests using 'pyside6' for GUI framework installation, while another expands the use of the "fun" tag in examples.
- Annotation Arrow Style Simplification: This pull request simplifies the annotation arrow style reference by using data coordinates instead of Axes coordinates. It also enhances the visual contrast of the annotation line by adjusting the colors of the point marker and textbox edge.
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: 13
Key Closed Pull Requests
1. merge up v3.10.1: This pull request involves merging version 3.10.1 into the main branch, incorporating numerous backported documentation improvements, bug fixes, and updates, such as fixing title positions for polar plots, addressing issues with modifying Axes' positions, and removing md5 usage to prevent problems on FIPS-enabled systems, along with various enhancements to the documentation and test suite.
- 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 includes commits to manage CI resources and apply 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 simplifying the continuous integration (CI) process by centralizing the installation of "ninja" rather than relying on system package managers.
- URL: pull/29740
- Merged: No
Other Closed Pull Requests
- Case-Sensitivity Bug in Backend Autodetection: This pull request addresses a case-sensitivity bug in the
matplotlib.pyplot
module affecting backend autodetection. It fixes an issue whereTkAgg
was not recognized as equivalent totkagg
, preventing backend auto-configuration.
- Handling of Singleton Sequence-Type Styles in
hist
Function: These pull requests correct the handling of singleton sequence-type styles in thehist
function of Matplotlib. They replace the inappropriate use ofnp.atleast_1d
withto_rgba_array
for color properties and refactor the logic for setting linestyles.
- Continuous Integration Issues on MacOS 14: These pull requests address continuous integration issues on MacOS 14 by temporarily setting an upper limit on the version of the 'PyGObject' Python package. They ensure that the CI process runs smoothly without version conflicts.
- Dependency Policy Update and Reversion: These pull requests involve updating the dependency policy link in the Matplotlib project from NEP 29 to SPEC 0 and then reverting the change. The reversion was due to inconsistencies and the need for a more comprehensive proposal.
- Consolidation of Tags in Matplotlib: These pull requests consolidate color and documentation tags in the Matplotlib project. They address issues #29753 and #29757, adding a colormap tag to a scatter example and closing the documentation tag issue.
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 | 38 | 7 | 4 | 48 |
rcomer | 9 | 5 | 2 | 17 |
story645 | 5 | 0 | 1 | 23 |
anntzer | 4 | 1 | 2 | 21 |
tacaswell | 9 | 1 | 0 | 15 |
jklymak | 2 | 0 | 0 | 21 |
dstansby | 11 | 6 | 3 | 3 |
jayaddison | 6 | 2 | 2 | 13 |
No author found | 16 | 0 | 0 | 0 |
QuLogic | 6 | 1 | 0 | 5 |