Weekly GitHub Report for Matplotlib: February 24, 2025 - March 03, 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.
-
[ENH]: Allow list of padding values for bar_label: This issue proposes an enhancement to the
bar_label
function in Matplotlib, allowing users to specify a list of padding values to address label overlap in bar plots. The current implementation only supports a single float value for padding, which applies uniformly to all labels, but the suggested change would enable more precise control by allowing different padding for individual labels.- Multiple contributors expressed interest in working on the issue, with discussions about who should proceed with a pull request. The community agreed on a courtesy waiting period to avoid duplicate work, and one contributor, who already had a fix ready, decided to wait before submitting their pull request.
- Number of comments this week: 8
-
[ENH]: Add long names for markers: This issue proposes the enhancement of adding long names for markers in the Matplotlib library, allowing for more readable code by using descriptive names like "circle" instead of single-character or integer markers, except in the
fmt
string syntax inplot()
. The suggested solution involves using long names from the existing marker descriptions with some adjustments, aiming to improve code readability and potentially phase out integer markers that complicate parsing and validation.- The comments discuss the feasibility of inverting the MarkerStyle dictionary to use long names, the need for tests and documentation updates, and the debate over whether
line.get_marker()
should return the original or a normalized marker representation. There is a consensus on the importance of testing and documenting the changes, with suggestions for updating the documentation to include both short and long marker names. - Number of comments this week: 4
- The comments discuss the feasibility of inverting the MarkerStyle dictionary to use long names, the need for tests and documentation updates, and the debate over whether
-
[MNT]: Up to ~60x worse Plotting Performance when using Units: This issue highlights a significant performance degradation, approximately 60 times slower, when plotting data using
pint_pandas
, a library for handling units inpandas
, due to the conversion ofSeries
objects into arrays ofQuantity
objects rather than arrays of plain numbers with units. The problem arises because theto_numpy()
method in thematplotlib
library creates an array with individualQuantity
objects, leading to inefficiencies, and the issue suggests that an API allowing for more efficient unit handling could benefit multiple libraries, not justpint
.- The comments discuss that
matplotlib
does not provide a converter forpint
, and the slowdown is due to unit information being attached to individual items rather than arrays. It is suggested thatpint_pandas
orpint
should handle this in their converters, asmatplotlib
provides hooks for such converters but does not implement them. The discussion also considers the possibility ofpint_pandas
changing itsto_numpy
method to return a singleQuantity
instance to improve performance. - Number of comments this week: 3
- The comments discuss that
-
[MNT]: Confusing edgecolor behavior for Patch and Collection: This issue addresses the confusing behavior of edge colors in Matplotlib's Patch and Collection objects, where edges are not drawn by default due to a change in how edge colors are handled, leading to unexpected results when using
rcParams["patch.edgecolor"]
. The proposed fix suggests introducing a new parameter,rcParams["patch.edgecolor_fallback"]
, to handle cases where the face color is "none," ensuring that artists are not rendered completely invisible.- The comments discuss the unexpected invisibility of artists when
facecolor="None"
andpatch.force_edgecolor=False
, with contributors analyzing the current behavior and suggesting fixes. A contributor offers to work on the issue, and another provides insights into the function_set_edgecolor()
, suggesting a condition to prevent invisibility. A pull request is made to codify the current behavior in tests, but it does not fully resolve the issue. - Number of comments this week: 2
- The comments discuss the unexpected invisibility of artists when
-
[Bug]: unstable
tkagg
small plot size window: This issue describes a bug in thetkagg
backend of Matplotlib where reducing the plot size causes the plot window to become unstable, changing size when the mouse moves and coordinates are displayed. The expected behavior is for the plot size to remain consistent, similar to theqtagg
backend, without being affected by the display of coordinates.- The comments discuss the problem of the plot window resizing due to cursor coordinates being displayed, with suggestions to configure the toolbar to prevent expansion. There is a discussion about setting a minimum widget size to avoid overflow, but this can lead to issues with figure sizes when saving. A potential solution using
pack_propagate(False)
in tkinter is mentioned to prevent child widgets from expanding their parent container. - Number of comments this week: 1
- The comments discuss the problem of the plot window resizing due to cursor coordinates being displayed, with suggestions to configure the toolbar to prevent expansion. There is a discussion about setting a minimum widget size to avoid overflow, but this can lead to issues with figure sizes when saving. A potential solution using
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 the release notes.
- [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 aims to enhance the interoperability of the Scientific Python ecosystem with Pyodide and facilitate interactive documentation through 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 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
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, including Matplotlib version 3.8.3 and Python version 3.10.13, and has been open for 358 days.
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:
- Enhancements to Matplotlib's marker and error bar functionality: The proposal to enhance Matplotlib includes adding support for long names for markers to improve code readability and facilitate the deprecation of integer markers. Additionally, a new parameter 'error_linestyle' is suggested for the
plt.errorbar()
function to allow users to set the linestyle of error bars directly, addressing the current limitation where the linestyle parameter only affects the main line.
- Bugs in Matplotlib related to race conditions and errors: A bug in Matplotlib involves a race condition between
TextBox
widgets when using thetoolmanager
with theQtAgg
backend, causing aValueError('already locked')
. Another issue is the "OSError: Bad file descriptor" error that occurs when repeatedly interrupting theplt.pause()
function in an IPython environment, which is unexpected behavior.
- LogLocator tick drawing bug in Matplotlib: There is a bug in the Matplotlib library where the LogLocator sometimes draws fewer ticks than possible. This issue is potentially caused by faulty formulas in the
tick_values()
method, leading to suboptimal log stride selection.
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: 6
Summarized Issues:
- Matplotlib Bugs with Color Limits and Plot Directives: Issues in Matplotlib include a bug where
set_clim()
does not adjust color limits correctly when a color bar is present, leading to incorrect visualizations. Another issue involves the plot directive failing to handle long option strings, affecting alt text rendering in HTML outputs.
- AttributeError and Backend Issues in Matplotlib: An AttributeError occurs in Matplotlib when used with Herbie due to a missing attribute, suggesting a need for reinstallation. Additionally, Matplotlib switches to a "headless" backend during SSH -X sessions, causing backend failures and requiring session restarts.
- Path and Memory Management Issues in Matplotlib: A discrepancy in LaTeX path recognition between Python IDLE and Mac Terminal results in a FileNotFoundError in IDLE, indicating path inheritance issues. Furthermore, a suspected memory leak in Matplotlib animations causes increased memory usage during figure resizing, affecting performance.
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. All other pull requests are grouped based on similar characteristics for easier analysis.
Pull Requests Opened This Week: 4
Key Open Pull Requests
1. DOC: document the issues with overlaying new mpl on old mpl: This pull request aims to document the issues associated with overlaying a new version of Matplotlib on top of an older version, addressing and closing issue #26827, and includes multiple commits that add notes on avoiding such overlays and update the documentation accordingly.
- URL: pull/29673
- Merged: No
2. DOC: Add policy for people stating concurrent interest: This pull request proposes a new policy for handling situations where multiple contributors express interest in working on the same issue by introducing a 24-hour courtesy period during which others should refrain from submitting a pull request if someone has already stated their intention to work on it, thereby providing clear guidelines and expectations to prevent conflicts and streamline the contribution process.
- URL: pull/29686
- Merged: No
- Associated Commits: 3378f
3. Add font feature API to FontProperties and Text: This pull request introduces a new API to the Matplotlib library, allowing users to access and utilize font features for alternate glyphs and shaping within a single font, which is supported by the mplcairo backend and will have an effect when used with libraqm, although it is not yet utilized by Matplotlib itself.
- URL: pull/29695
- Merged: No
- Associated Commits: a5a89
Other Open Pull Requests
- Enhancement of
bar_label
function in Matplotlib: This pull request introduces the enhancement of allowing per-label padding in thebar_label
function of Matplotlib. It enables users to specify individual padding values for each label through an array-like object, thereby providing greater customization and preventing label overlap, as opposed to the previous limitation of a single float value for all labels.
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. All other pull requests are grouped based on similar characteristics for easier analysis.
Pull Requests Closed This Week: 19
Key Closed Pull Requests
1. DOC: Revising the Figure Legend Demo Example: This pull request involves revising the Figure Legend Demo Example in the Matplotlib project by elaborating on the differences between the 'outside left upper' and 'outside upper right' legend locations, consolidating the figlegend_demo.py
into a single graph, and removing trailing white spaces, as documented in several commits.
- URL: pull/29666
- Merged: 2025-02-25T09:52:40Z
2. Blocked set_clim() callbacks to prevent inconsistent state (#29522): This pull request addresses issue #29522 by blocking immediate callbacks from the set_clim()
function to prevent an inconsistent state, instead emitting an update signal after both limits are set, and includes tests to ensure the correct number of callbacks are triggered.
- URL: pull/29590
- Merged: 2025-02-28T15:24:41Z
3. DOC: Recommend constrained_layout over tight_layout: This pull request updates the documentation to recommend using 'constrained_layout' over 'tight_layout' in Matplotlib, addressing the remaining open issue #17339 and including contributions from multiple authors to update relevant files and guides.
- URL: pull/29584
- Merged: 2025-02-28T11:51:08Z
Other Closed Pull Requests
- Documentation Updates for Marginal Scatter Plots: This pull request updates the documentation to replace the use of
add_gridspec
and multipleadd_subplot
calls withsubplot_mosaic
for creating marginal scatter plots. The intention is to simplify the process and reduce the need for users to utilize gridspec.
- Colorbar Parameters Documentation: This pull request involves moving the Colorbar parameters to the
__init__
method to prevent numpydoc from incorrectly inserting Attributes between Parameters and Other Parameters. It aligns with a common documentation pattern used in the project.
- Figure Legend Demo Example Documentation: This pull request involves backporting changes to the v3.10.x and v3.10.0-doc branches, specifically revising the documentation for the Figure Legend Demo Example. It was successfully merged on February 25, 2025.
- Event Handling Example Script Bug Fix: This pull request addresses a bug in the Matplotlib example script
examples\event_handling\data_browser.py
by updating it to comply with the library's requirement that line data modifications must be sequences. This resolves errors that occur when running the script and closes issue #22329.
- Sphinx Directives Handling: This pull request addresses the incorrect handling of
alt
andcaption
values in Sphinx directives by modifying the templating process. It ensures these values are correctly copied and wrapped, fixing issues with invalid HTML when alt text contains quotes.
- Test Cases for
patch.force_edgecolor
: This pull request adds test cases to the Matplotlib project to verify the behavior of thepatch.force_edgecolor
feature when thefacecolor
is set to "none". It addresses issue #29261 and includes contributions from Elliott Sales de Andrade.
- Align Labels and Titles in Gallery Examples: This pull request consolidates the "align_labels_demo" and "align_ylabels" gallery examples by introducing clearer label names. It adds a y-axis label for the top-right subplot and titles for the two lower subplots to enhance clarity.
- Context Manager for Default Figure Class: This pull request introduces a context manager to the default figure class returned by
plt.figure()
in the Matplotlib library. It aims to facilitate interactions with other libraries by automatically managing the closure of figures.
- Layout Management Recommendation: This pull request involves backporting documentation changes, specifically recommending the use of 'constrained_layout' over 'tight_layout' for layout management. It was successfully merged on February 28, 2025.
- Blocking
set_clim()
Callbacks: This pull request involves backporting changes to blockset_clim()
callbacks to prevent an inconsistent state. It was successfully merged on February 28, 2025.
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 | 42 | 18 | 5 | 88 |
story645 | 6 | 2 | 1 | 45 |
tacaswell | 9 | 2 | 0 | 23 |
QuLogic | 12 | 3 | 0 | 18 |
star1327p | 25 | 4 | 0 | 4 |
anntzer | 8 | 6 | 2 | 17 |
meeseeksmachine | 0 | 33 | 0 | 0 |
jklymak | 2 | 1 | 0 | 28 |
trygvrad | 11 | 0 | 0 | 15 |
rcomer | 6 | 2 | 0 | 10 |