Weekly GitHub Report for Matplotlib: April 07, 2025 - April 14, 2025 (12:03:56)
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]: Backgroundcolor of text is set in a too wide range: This issue describes a bug in the Matplotlib library where the background color of text is set in an overly broad range, resulting in a persistent border of the initial color when the background color is changed. The problem occurs because the text's background is managed by an internal patch that retains a finite linewidth, causing the border to remain visible even after attempting to reset the background color.
- The comments discuss the internal mechanism of the text background, suggesting that the issue arises from the initialization of a patch with a default linewidth. Various solutions are proposed, including setting the edge color to 'none' or matching it with the face color, but these have trade-offs such as changing the box size or being counter-intuitive. Improved documentation is suggested as a potential resolution, and a workaround is provided to remove the background patch entirely.
- Number of comments this week: 5
-
[Bug]: image alpha re-applied each draw?: This issue reports a bug in the Matplotlib library where an RGBA image becomes progressively darker when the GUI window is resized repeatedly. The problem is traced back to a specific commit and is believed to be related to the way the alpha channel is handled during image rendering.
- The comments discuss the potential cause of the issue, suggesting that the problem arises from multiplying the original array for RGBA images. A specific line of code is identified as the source of the bug, and a proposed fix involves adjusting the in-place multiplication. A contributor has started working on a branch to address the issue and plans to submit a pull request for further discussion.
- Number of comments this week: 5
-
[Bug]: \right) is replaced with exclamation mark when using fontset='cm': This issue describes a bug in the Matplotlib library where the right parenthesis in certain LaTeX expressions is incorrectly replaced with an exclamation mark when using the 'cm' fontset. The problem occurs specifically when both the upper and lower bounds of an integral are set, and it does not affect other mathematical symbols like (\sum) or (\iint).
- Several users commented on their inability to reproduce the issue, while one user confirmed they could replicate it on their system. The discussion included questions about the installation method of LaTeX, and one user mentioned having installation issues on their Windows laptop, preventing them from testing.
- Number of comments this week: 4
-
[Bug]: plt.show() works intermittently in PyCharm: This issue describes a bug where the
matplotlib.pyplot.show()
function behaves inconsistently in PyCharm, sometimes failing to display plots even though the script runs without errors. The problem is linked to the use of theAgg
backend, which is non-interactive and does not support GUI windows, leading to a warning message when attempting to display plots.- A commenter suggests that the issue arises from the
Agg
backend being selected, which lacks GUI support, and recommends specifying a different backend likeqtagg
to resolve the issue. They also mention that PyCharm might have its own backend, possibly available only in the Pro version, and advise checking the current backend withmpl.get_backend()
. - Number of comments this week: 1
- A commenter suggests that the issue arises from the
-
[Doc]: Autoscaling Axes or Autoscaling Axis?: This issue highlights a discrepancy in the documentation of a project where the term "Autoscaling Axes" is used in the navigation, while "Autoscaling Axis" is used on the document page, leading to confusion about whether there is a difference between the two terms. The user suggests that the documentation should consistently use "Autoscaling Axis" to avoid confusion and requests clarification on the terms.
- A commenter expressed interest in working on the issue and asked for guidance on how to proceed.
- Number of comments this week: 1
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 when used with categorical variables and thedensity=True
parameter, where the density values are incorrectly computed due to the internal conversion of categories to integers, leading to miscalculated bin widths and unexpected density outcomes. Additionally, the issue addresses the misalignment of labels, as the function does not position them at the center of the bars, complicating the process of accurately plotting labels due to the lack of transparency in 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 involving either the
make html
command or editing configuration files, both of which can be cumbersome and produce numerous warnings. The proposed solution suggests improving documentation and configuration to streamline this process, making it more accessible for developers, especially beginners, who need to frequently preview individual gallery entries. - [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 in the provided code example.
- [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 to improve the user interface by implementing consistent precision across different types of formatters.
- [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
), contrary to what the documentation suggests. The user reports that this discrepancy requires manual intervention to update the data limits, which can lead to confusion and unexpected behavior when plotting data.
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: 5
Summarized Issues:
- Matplotlib Plot Display Issues: The
matplotlib.pyplot.show()
function intermittently fails to display plots in PyCharm due to the selection of the non-interactive 'Agg' backend. This results in inconsistent plot display behavior despite the script running without errors.
- Matplotlib Mathtext Rendering Bug: When using the 'cm' fontset for mathtext in Matplotlib, the right parenthesis in certain LaTeX expressions is incorrectly rendered as an exclamation mark. This issue occurs particularly when both upper and lower bounds are set for an integral, while other symbols like (\sum) or (\iint) do not exhibit this problem.
- Matplotlib RGBA Image Darkening: Plotting an RGBA image and resizing the GUI window in Matplotlib causes the image to progressively darken. This is likely due to the alpha channel being incorrectly re-applied with each redraw, traced back to a specific code change.
- Matplotlib Documentation Inconsistency: There is a terminology inconsistency in the Matplotlib documentation where "Autoscaling Axes" is used in navigation, but "Autoscaling Axis" appears on the document page. It is suggested that the terminology should be standardized to "Autoscaling Axis" throughout to avoid confusion.
- Matplotlib Code Redundancy: In the
figure.py
file of the Matplotlib project, theset_dpi
andget_dpi
functions are defined twice. If there is no valid reason for this duplication, one set of these functions should be removed to clean up the code.
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: 1
Summarized Issues:
-
Backward Compatibility in Matplotlib's
draw_quad_mesh
: Thedraw_quad_mesh
function in Matplotlib has a bug related to backward compatibility with third-party backends. Specifically, the issue arises when using thehatchcolors
keyword argument, which is not supported by some backends like mplcairo, leading to a TypeError.
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: 13
Key Open Pull Requests
1. Show subprocess stdout and stderr on pytest failure: This pull request aims to enhance the debugging process by displaying the captured stdout
and stderr
outputs when a pytest test that utilizes the subprocess helper fails, thereby providing more detailed information for diagnosing test failures.
- URL: pull/29890
- Merged: No
2. Adding elinestyle property to errorbar: This pull request introduces an "elinestyle" property to the errorbar function in Matplotlib, allowing users to specify the line style of error lines directly when creating an errorbar, thereby simplifying the process of customizing error line styles without needing to individually adjust the horizontal and vertical line objects.
- URL: pull/29879
- Merged: No
3. API: bump minimum supported version of Python and numpy: This pull request proposes to update the minimum supported versions of Python to 3.11 and NumPy to 1.25 for the next release of the Matplotlib project, in line with the project's policy, and includes documentation updates and build adjustments to reflect these changes.
- URL: pull/29904
- Merged: No
Other Open Pull Requests
- Codecov Test Analytics Integration: This pull request introduces Codecov Test Analytics into the continuous integration pipeline to identify flaky and failed tests. It adds support for the junitxml format and integrates the Codecov test analytics action, while addressing issues related to differentiating between 'linux' and 'linux-arm64' in the test results upload process.
- Error Bar Cap Color Bug Fix: This pull request addresses a bug by ensuring that the color of error bar caps in Matplotlib is no longer affected by the global 'lines.markeredgecolor' setting. The caps now use the specified 'ecolor' independently, with changes made to the _axes.py and test_axes.py files.
- Type Annotation and Mismatch Fixes: This pull request addresses a type annotation issue in the
plt.subplot_mosaic
function by changing the expected argument type to resolve compatibility errors. Additionally, it resolves a type mismatch issue by aligning types for width and height with BufferRegion definitions, fixing a narrowing error identified by clang.
- Error Handling in
errorbar
Function: This pull request addresses a bug in theerrorbar
function by ensuring it does not raise an exception when encountering masked negative errors. It refines the check for negative values, allowing the use of masked arrays without discarding masks or causing runtime errors.
- Font Metrics and Text Placeholder Improvements: This pull request addresses the issue of font metrics affecting tests with empty legend labels by using text placeholders. It ensures that even when legend labels are empty, they do not impact line height calculations, and it depends on another pull request for full implementation.
- Image Processing Enhancements: This pull request addresses the issue of black corners appearing when rotating RGB images by converting them to RGBA format within the
AxesImage.make_image
function. It ensures resampling artifacts are prevented during affine transformations and includes tests to verify the fix.
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: 16
Key Closed Pull Requests
1. Update lib/matplotlib/stackplot.py: This pull request updates the lib/matplotlib/stackplot.py
file by revising minimal examples to enhance clarity, as evidenced by multiple commits that include simplifying updates, rephrasing examples, and removing trailing whitespaces, ultimately improving the documentation and usability of the stackplot functionality in the Matplotlib library.
- URL: pull/29853
- Merged: 2025-04-07T00:18:46Z
2. Use ruff instead of flake8 to check PEP8: This pull request involves switching the PEP8 compliance checking tool from flake8
to ruff
in the Matplotlib project, primarily to eliminate the need for maintaining duplicate configurations and to leverage ruff
's capability to automatically fix many PEP8 violations, thereby streamlining the development process.
- URL: pull/29762
- Merged: 2025-04-09T22:38:18Z
3. MVP of testing figures using hash comparison: This pull request introduces a minimum viable product for testing figures using hash-based comparison instead of direct figure comparison, aiming to validate the feasibility of this approach on continuous integration systems with the help of pytest-mpl
.
- URL: pull/29823
- Merged: No
Other Closed Pull Requests
- Documentation Enhancements: This topic covers improvements to the documentation of the Matplotlib library. The pull requests focus on enhancing the docstring for the
FancyArrowPatch
class and improving the description of background and bounding box handling for text elements.
- Backporting Documentation Improvements: These pull requests involve backporting documentation enhancements to different branches of the Matplotlib project. They ensure that improvements to the
FancyArrowPatch
class docstring and the documentation of basic units are consistent across versions.
- Layout Test Modifications: This pull request modifies layout tests by using placeholders for text, ensuring consistency across different font settings. It involves patching the
Text
object to draw a rectangle instead of relying on font properties.
- Code Compatibility and Clarity Improvements: These pull requests focus on improving code compatibility and clarity in the Matplotlib library. They address issues with the
.T
attribute in the_reshape_2D
function and enhance type checking compatibility withmpl_connect
.
- Backporting Code Changes: This pull request involves backporting changes to the v3.10.x branch, specifically replacing the
.T
attribute with the.transpose()
method in the_reshape_2D
function. It aims to improve code clarity or functionality.
- Basic Units Documentation: This pull request aims to minimally document the functionality of the "basic units" feature in the Matplotlib library. It provides a brief explanation to help users understand its implementation as a mini library.
- Removal of Unsupported Parameters: This pull request removes the
hatchcolors
parameter from thedraw_quad_mesh()
function. The change addresses and fixes an issue related to the unsupported hatching in theQuadMesh
class.
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 | 3 | 6 | 46 |
jayaddison | 47 | 1 | 5 | 5 |
anntzer | 15 | 4 | 3 | 31 |
QuLogic | 14 | 6 | 0 | 17 |
rcomer | 6 | 1 | 3 | 18 |
dstansby | 15 | 3 | 0 | 9 |
jklymak | 4 | 1 | 3 | 18 |
trygvrad | 4 | 2 | 0 | 11 |
tacaswell | 6 | 1 | 0 | 9 |
story645 | 3 | 2 | 0 | 6 |