Weekly GitHub Report for Matplotlib: March 24, 2025 - March 31, 2025 (12:02:52)
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.
-
[ENH]: Make savefig close plot by default: This issue proposes an enhancement to the Matplotlib library, suggesting that the
savefig
function should automatically close the plot after saving it, as the user often does not need the plot once it is saved. The user suggests adding an option to keep the plot open for those who might need it, aiming to streamline the process by reducing the need to manually callplt.close()
after eachsavefig
operation.- The comments reflect a debate on the proposed change, with some users arguing that automatically closing plots after saving could disrupt workflows where plots are modified and saved multiple times. Others suggest alternative solutions, such as using context managers or modifying the current workflow to avoid using
pyplot
for non-interactive use cases. There is a consensus that the current behavior should not change by default, as it aligns with common practices in other software, and any new feature should be optional to avoid breaking existing workflows. - Number of comments this week: 31
- The comments reflect a debate on the proposed change, with some users arguing that automatically closing plots after saving could disrupt workflows where plots are modified and saved multiple times. Others suggest alternative solutions, such as using context managers or modifying the current workflow to avoid using
-
[Tracker]: free-threaded Python support: This issue is focused on tracking the progress and challenges related to supporting free-threaded Python (no-GIL) in the upcoming CPython 3.13 builds for the Matplotlib project. It highlights the need for a thorough review of all modules to identify and address potential concurrency issues, inviting community input to ensure thread safety and compliance.
- The comments discuss testing and compatibility issues with free-threaded Python, particularly with
pybind11
andkiwisolver
, and mention efforts to update dependencies and internal modules for free-threading support. There are concerns about thread safety in the MacOS backend, with suggestions to document potential issues and follow NumPy's lead in handling threading. Several contributors express willingness to submit pull requests to address these challenges. - Number of comments this week: 6
- The comments discuss testing and compatibility issues with free-threaded Python, particularly with
-
[MNT]: Flaky Windows_py31x tests on Azure Pipelines: This issue highlights the unreliability of the
Windows_py310
Azure Pipelines test jobs in the GitHub Actions for the repository, where test timeouts and failures occur on both pull requests and mainline branch checks, seemingly unrelated to the specific commits being tested. The problem is suspected to be temporary, but no proposed fix has been identified yet, and similar issues have been noted on other Python versions, albeit less frequently.- The comments discuss the occurrence of similar flaky behavior on
Windows_py312
, with a commonality insubprocess
-related test failures due to timeouts. The issue has persisted for some time, possibly since early in the year, affecting several past pull requests. There is speculation about the use ofsubprocess.PIPE
in the failing tests, and a suggestion to deprioritize the issue due to upcoming deprecation of Python 3.10 support, though it is noted that the issue also affects newer Python versions. - Number of comments this week: 5
- The comments discuss the occurrence of similar flaky behavior on
-
[Bug]: unaligned multiline text when using math mode: This issue involves a bug in the Matplotlib library where multiline text containing math mode text is not properly aligned, resulting in a slight mismatch between lines. The problem is demonstrated with a code snippet and an image, highlighting the misalignment when using math mode in one of the lines.
- A user expressed intent to fix the issue, mentioning it was their first attempt. Another user sought guidance on resolving the bug, proposing a complex solution involving character offsets, but acknowledged its limitations. A third user suggested a root cause analysis might be necessary, as the proposed solution seemed unreliable.
- Number of comments this week: 3
-
[Bug]: Unit tests: MacOS 14 failures: gi-invoke-error-quark: This issue reports a bug encountered during GitHub Actions workflows for a pull request, where unit tests on MacOS 14 fail due to an error related to the inability to locate the
libglib-2.0.0.dylib
library file. The problem seems to be linked to a recent dependency version upgrade inPyGObject
, which affects the loading of dynamic library files, causing the tests to fail on MacOS 14 with Python versions 3.12 and 3.13.- The comments discuss the missing
libglib-2.0.0.dylib
file, suggesting it should be provided by theglib
Homebrew package. A potential link toPyGObject
version upgrades is explored, with a temporary fix by pinningPyGObject<3.52.0
allowing tests to pass. Further investigation reveals issues withcairo
andpycairo
dependencies, leading to discussions about using Homebrew's packages and a possible bug in theglib
Homebrew formula. The issue remains unresolved, with plans to revisit the problem after a break. - Number of comments this week: 2
- The comments discuss the missing
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 due to the internal conversion of categories to integers, which affects the bin width and results in miscalculated density values. Additionally, the issue addresses the misalignment of labels, as the function does not position them precisely at the center of the bars, complicating the process of plotting labels correctly due to the lack of 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 is currently a time-consuming process requiring either a full
make html
build or editing configuration files to skip subdirectories, often resulting in numerous 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 ParseFatalException due to being an unrecognized symbol in the module.
- [ENH]: Fix precision displayed by LogFormatter.format_data_short: This issue is about enhancing the LogFormatter in the Matplotlib project to display mouse cursor values with a precision that matches the cursor pointing accuracy, similar to what has been implemented for linear formatters. The current lack of this feature in log formatters is identified as a problem, and the issue has been open for 353 days without a proposed solution.
- [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 data limits using methods likeset_xlim
andset_ylim
, which is not clearly communicated in the documentation, leading to confusion and unexpected behavior in data coordinate transformations.
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:
- Unreliable Azure Pipelines Test Jobs: The
Windows_py310
Azure Pipelines test jobs in the Matplotlib repository are frequently timing out or failing, especially withsubprocess
-related tests. This issue has been observed across multiple pull requests and branches, with no clear cause identified yet.
- Arabic Language Support in Plots: Matplotlib plots currently lack proper Arabic language support, with issues in left-to-right rendering and disconnected characters. Proposed solutions include integrating Arabic reshaping and bidi support, using compatible fonts, and potentially auto-detecting Arabic text for correct rendering.
- Internal Import Dependencies and Initialization: There is a need to clean up and simplify Matplotlib's internal import dependencies and initialization logic. The proposal suggests decoupling module imports from initialization processes and managing them centrally by the top-level module.
- Future Support for
axes_grid
Feature: The Matplotlib library needs to decide on the future support level for theaxes_grid
feature, which is currently in a mildly deprecated state. Considerations include deprecating it, integrating its functionality into the main library, or announcing plans for its replacement.
cairocffi
Dependency in CI Paths: Thecairocffi
dependency in the CI paths for Matplotlib was initially added for now-unsupportedpgi
object bindings. Its presence might obscure failures related topycairo
, with a proposed solution to create a separate CI test matrix forcairocffi
or remove it from the CI dependencies.
- Replacing Text with Shapes in Layout Manager Tests: To reduce variability in image tests caused by font changes, it is proposed to replace text with shapes in layout manager tests. This method would create nominal shapes based on text size parameters to ensure consistent testing of subplot positioning.
- Addition of
ax.fancyarrow()
Method: A new method,ax.fancyarrow()
, is proposed to simplify drawing arrows between two points in Matplotlib. This addresses the limitations of existing methods by providing a more straightforward solution using a FancyArrowPatch wrapper.
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: 10
Summarized Issues:
- Polar Plotting Bugs: The issue with Matplotlib's polar plotting involves a bug where using
set_rticks
causes incorrect autoscaling of radial limits, moving the origin away from zero. This behavior is unexpected when plotting data without negative radius values, leading to inaccurate visual representations.
- Import Errors with Qt Bindings: Users have encountered ImportErrors when using Matplotlib with PyQt6, PySide6, and in certain versions due to misconfigurations or residual files from previous installations. These issues often require manual intervention, such as deleting outdated directories or ensuring proper setup in development environments.
- Enhancements and Configuration: There is a proposal to enhance Matplotlib by allowing default color cycles to be set using named color sequences in the configuration file. This enhancement aims to provide more flexibility while addressing potential ambiguities with user-defined or third-party color names.
- Documentation and Rendering Issues: A bug in Matplotlib's documentation build process triggers a UserWarning due to a failure in rendering a math expression, linked to a pyparsing update. This issue was resolved with a subsequent fix in pyparsing, highlighting the importance of keeping dependencies up to date.
- Colorbar and Layout Bugs: A bug in Matplotlib's colorbar functionality within a 4x4 ImageGrid prevents colorbars from using the full width when the
extend
argument is set. This results in misaligned labels, and a workaround involves using core Matplotlib with a compressed layout, asaxes_grid1
is in "maintenance mode."
- Compatibility Issues with PyQt5: A TypeError occurs when adding a
PlotSpar_Qt
object to aQVBoxLayout
in a PyQt5 application, likely due to compatibility issues with the latest Matplotlib versions. Users need to be aware of potential compatibility problems when updating libraries.
- Backporting Fixes: There is a request to backport a fix from the main branch to the 3.10.x branch of Matplotlib, as the fix addresses a bug introduced in earlier versions. This highlights the need for maintaining consistency across different branches to ensure stability.
- Improving Figure Access: Users have suggested improving access to the
Figure
class in Matplotlib by including starter functions at the top level. This change would simplify workflows, especially in Jupyter notebooks, by reducing reliance on the state-basedpyplot
interface and improving garbage collection.
- Challenges with ConnectionPatch: Users face challenges in controlling the size and position of arrows on connection lines when creating global traffic flow maps using Matplotlib's ConnectionPatch. Despite trying various parameters, achieving consistent sizing and positioning remains difficult.
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. Update FreeType to 2.13.3: This pull request proposes updating the FreeType library to version 2.13.3 in the Matplotlib project, highlighting the benefits of newer font features and security fixes, while addressing potential issues with repository size increase and compatibility with libraqm, as well as noting the need for further checks on image changes and compliance with project documentation and testing guidelines.
- URL: pull/29816
- Merged: No
2. MVP of testing figures using hash comparison: This pull request introduces a minimum viable product for testing figures by implementing a hash-based comparison method instead of direct figure comparison, aiming to validate its feasibility on continuous integration using pytest-mpl
.
- URL: pull/29823
- Merged: No
3. ci: rotate soon-to-be-unsupported GitHub Actions ubuntu-20.04 runner out of roster: This pull request updates the GitHub Actions configuration by replacing the soon-to-be-unsupported Ubuntu 20.04 runner with Ubuntu 22.04 in the tests.yml
workflows, ensuring continued functionality of CI checks and allowing the removal of specific Python package version pins.
- URL: pull/29796
- Merged: No
- Associated Commits: 7b8b6
Other Open Pull Requests
- Documentation Enhancement for FancyArrowPatch: This pull request focuses on improving the documentation of the FancyArrowPatch class in the Matplotlib library. The enhancement is achieved by refining its docstring to provide clearer and more comprehensive information.
- Support for LuaTeX and XeTeX in Matplotlib: This topic covers the addition of support for LuaTeX and XeTeX as alternative engines for the
usetex
feature in Matplotlib. The pull requests focus on DVI generation and parsing, with current rendering limited to the SVG backend, and highlight the need for further development in font selection and rendering support across other backends.
- Testing Process Streamlining: This pull request aims to streamline the testing process by removing unnecessary test images for certain types of tests. It ensures that the remaining code is adequately tested while focusing on wrapper functions, spine or tick settings, and alternate Axes projections.
- Code Readability and Maintenance: This topic involves efforts to enhance code readability and maintainability in the Matplotlib project. The pull requests propose inlining functions to eliminate the need for extensive documentation and removing deprecated features to keep the codebase clean and up-to-date.
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: 15
Key Closed Pull Requests
1. Ensure polar plot radial lower limit remains at 0 after set_rticks + plot: This pull request addresses an issue in polar plots where the lower radial limit, which should always remain at 0, was being incorrectly adjusted by autoscaling logic after using set_rticks
followed by plot
, by ensuring that the RadialLocator
behavior is preserved and explicitly enforcing the lower limit of 0 in the handle_single_axis
function, along with adding a test to verify this behavior.
- URL: pull/29798
- Merged: 2025-03-29T20:25:52Z
2. Fixing English spelling errors: This pull request addresses the correction of several English spelling errors found in the docstrings of the Matplotlib project, aiming to enhance the quality of the documentation, although it was not merged, possibly due to the presence of a codespell
pre-commit hook that might intentionally preserve certain spelling errors.
- URL: pull/29795
- Merged: No
3. Prepare for {xe,lua}tex support in usetex.: This pull request involves preparatory changes for supporting {xe,lua}tex in the Matplotlib library by moving the listing of Type1 glyph widths to the backend_pdf, renaming a confusingly named function related to Dvi fixed-point values, and clarifying documentation for Tfm.design_size, all aimed at improving the handling of font embedding and documentation accuracy.
- URL: pull/29817
- Merged: 2025-03-27T23:13:12Z
Other Closed Pull Requests
- Documentation Enhancements: This topic includes improvements to the Matplotlib documentation, such as correcting a
git fetch
command error and enhancing the arrowstyle demonstration. These changes aim to assist new contributors and improve the clarity and presentation of documentation elements.
- Rendering and Image Processing: The pull requests under this topic focus on improving image rendering in Matplotlib, specifically addressing filtering in premultiplied alpha mode and ensuring error bar caps use the correct color. These changes aim to resolve rendering discrepancies and improve visual accuracy.
- Color and Style Configuration: This topic covers changes to the default color cycle and arrowstyle demo in Matplotlib, ensuring clarity in color sequence interpretation and enhancing the visual presentation of arrows. These updates aim to prevent misinterpretation and improve user experience.
- Backend and Compatibility Updates: Pull requests in this category address backend support and compatibility, including free-threaded support in the MacOS backend and setting PyQt6 as the default Qt. These updates ensure better compatibility and performance across different systems.
- Action and Workflow Improvements: This topic involves updating the setup-python action to version 5.5.0 and replacing "quansight-labs/setup-python" with "actions/setup-python". These changes streamline the workflow and ensure the use of up-to-date tools.
- Bug Fixes and Backports: This category includes backporting a bug fix for the Histogram function and improvements to the arrowstyle demo documentation. These efforts ensure that important fixes and enhancements are available in older branches.
- Debugging and Parsing Enhancements: Enhancements to the debug output of DVI parsing are covered under this topic, including resolving glyphs to Unicode and improving alignment. These changes prepare the codebase for future support of broader glyph ranges.
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 | 30 | 10 | 5 | 90 |
jayaddison | 50 | 5 | 5 | 35 |
dstansby | 23 | 10 | 3 | 29 |
rcomer | 9 | 9 | 3 | 41 |
anntzer | 12 | 10 | 4 | 36 |
jklymak | 0 | 0 | 3 | 36 |
story645 | 5 | 2 | 0 | 27 |
QuLogic | 8 | 4 | 0 | 17 |
meeseeksmachine | 0 | 22 | 0 | 0 |
tacaswell | 2 | 0 | 0 | 18 |