Weekly GitHub Report for Matplotlib: March 31, 2025 - April 07, 2025 (12:02:53)
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.
-
[MNT]: Lifetime of pyplot figures: This issue discusses the potential for changing the lifetime behavior of figures in Matplotlib's
pyplot
to reduce the need for users to manually manage figure references and calls toclose()
, while maintaining compatibility with existing usage patterns. The proposed solution suggests auto-deleting figures that are not shown, not active, and do not have user-created figure numbers, which could simplify figure management for most users but might break certain edge cases.- The comments discuss various use cases and potential issues with the proposed changes, including the need to register existing figures, the possibility of showing figures in a GUI after creation, and concerns about breaking common patterns where figures are shown together. There is also a discussion about the challenges of auto-cleaning figures while maintaining backward compatibility, highlighting the complexity of implementing such changes without disrupting existing workflows.
- Number of comments this week: 6
-
[Bug]: Unable to install matplotlib (editable mode) in Github Codespace: This issue involves a bug encountered when attempting to install Matplotlib in editable mode within a GitHub Codespace, resulting in an ImportError due to an undefined symbol. The error seems to be linked to a recent merge in the codebase, and a workaround involving setting an environment variable has been identified.
- The comments discuss a similar issue encountered locally, suggest that a recent code merge might be the cause, and propose setting
export AR=$GCC_AR
as a solution. This workaround resolves the issue, and further context is provided about the compiler settings in conda-forge that might be contributing to the problem. - Number of comments this week: 4
- The comments discuss a similar issue encountered locally, suggest that a recent code merge might be the cause, and propose setting
-
[ENH]: Should we hide _preprocess_data from the stack trace?: This issue discusses whether the
_preprocess_data
decorator should be hidden from the stack trace when an exception is raised, as its presence can make the stack trace harder to read and distract from the actual error. The proposed solution involves modifying the traceback to filter out the decorator's frame, but there is a debate on whether this approach might hinder debugging if the decorator itself contains a bug.- The comments discuss concerns about debugging if the decorator is hidden, with suggestions to use
__tracebackhide__
for IPython and pytest to simplify the process without custom logic. - Number of comments this week: 4
- The comments discuss concerns about debugging if the decorator is hidden, with suggestions to use
-
[Doc]: Surprising behavior of FuncAnimation example in the first frames: This issue highlights unexpected behavior in the initial frames of a
FuncAnimation
example from the Matplotlib documentation, where the first frame appears empty due to the way slices are taken, and suggests a modification to the frame range to correct this. Additionally, it points out an inconsistency between how the animation is displayed interactively versus when saved as a GIF, with the initial state not appearing in the saved version, and questions whether a separate issue should be opened for this discrepancy.- The comments discuss the current behavior of the animation, noting that the initial plot is not part of the animation and suggesting that the startup behavior might be incorrect. A potential solution involves rendering the first frame as part of the startup process, though this may require significant changes to the animation's architecture.
- Number of comments this week: 2
-
[MNT]: CI: pygobject fails to install during ubuntu-22.04 GitHub Actions jobs: This issue addresses a problem with the installation of the
PyGObject
package during GitHub Actions test jobs on Ubuntu 22.04, where the package fails to install due to a dependency ongirepository-2.0
that is not met. The proposed solution is to pin thePyGObject
version to below 3.52.0 in the test workflows to ensure compatibility with the currently installedgirepository-1.0
.- A commenter suggests an alternative fix by installing
girepository-2.0
instead, but prefers the proposed solution to maintain test coverage for olderPyGObject
versions, which might still be used in some production systems. - Number of comments this week: 1
- A commenter suggests an alternative fix by installing
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 the Matplotlib library 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, and suggests improvements such as setting the bin width to 1 for categorical data and providing clear 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 currently requires a lengthy process involving either running
make html
or editing.mpl_skip_subdirs.yaml
and still results in numerous warnings. The proposed solution suggests improving documentation and configuration to streamline the 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, it is not recognized by the mathtext parser, leading to an error when rendering these expressions.
- [ENH]: Fix precision displayed by LogFormatter.format_data_short: This issue pertains to the enhancement of the LogFormatter in a GitHub project, specifically to improve the precision of values displayed by the formatter to match the cursor pointing precision, similar to what has been implemented for linear formatters. The problem identified is that while linear formatters already display values with the appropriate number of significant digits, this feature has not yet been implemented for log formatters, and the issue suggests that it would be beneficial to have this consistency.
- [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, as demonstrated by the provided code example.
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: 9
Summarized Issues:
- PyGObject Installation Issues on Ubuntu 22.04: The installation of the
PyGObject
Python package fails during GitHub Actions test jobs on Ubuntu 22.04 due to a missing dependency ongirepository-2.0
. The proposed solution is to pin thePyGObject
version to below 3.52.0 to avoid this issue.
- Lifetime Behavior of Figures in Matplotlib's
pyplot
: There is a proposal to change the lifetime behavior of figures in Matplotlib'spyplot
module to reduce manual management of figure references. This involves automatically deleting figures that are not shown, not active, and lack user-created figure numbers, while considering existing usage patterns and edge cases.
- Installation Issues in GitHub Codespace: Installing Matplotlib in editable mode within a GitHub Codespace results in an ImportError due to an undefined symbol. This issue is likely caused by a recent merge and may be resolved by setting the
AR
environment variable toGCC_AR
before building.
- Timeout Error on Slow Machines: Building from a freshly cloned repository on a slower machine results in a timeout error due to an outdated git index. Suggested solutions include increasing the timeout, updating development instructions, or improving the error message for clarity.
- Inconsistent Animation Frame in
FuncAnimation
: TheFuncAnimation
example in Matplotlib's documentation shows inconsistent initial frame behavior between interactive viewing and saved GIFs. This leads to unexpected disappearance and reappearance of points, suggesting a need to adjust the startup behavior of animations.
ax.pie()
Function Handling ofNaN
Values: Theax.pie()
function in Matplotlib raises aValueError
when input data contains aNaN
value. It is suggested that the function should either filter outNaN
values or provide a clearer error message, as the current behavior is not documented.
- Hiding
_preprocess_data
Decorator from Stack Trace: There is a discussion on whether the_preprocess_data
decorator should be hidden from the stack trace to make it less distracting and easier to read. The potential impact on debugging if the decorator itself contains a bug is also considered.
- Typeface Specification in Matplotlib: An enhancement is proposed to allow users to specify a typeface instead of individual fonts for each font family in Matplotlib. This would simplify maintaining a consistent appearance across different font families by introducing a configuration option like
font.typeface
.
- Background Color Bug in Matplotlib: A bug in Matplotlib causes the background color of text to be set over an excessively wide range, leaving a persistent border of the first color. This issue is demonstrated in the provided Python code and image.
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: 9
Summarized Issues:
- Ubuntu Version and Dependency Issues: The Matplotlib project faces challenges with Ubuntu versions and dependencies. Ubuntu 22.04 does not support the latest PyGObject package due to missing system dependencies, impacting GTK-related tests. Additionally, there's a need to update the GitHub Actions workflow by removing the unsupported
ubuntu-20.04
runner and transitioning to a newer version likeubuntu-22.04
.
- Matplotlib Method Enhancements and Bug Fixes: Enhancements and bug fixes are proposed for Matplotlib's methods. A new method,
ax.fancyarrow()
, is suggested to improve arrow drawing capabilities, addressing limitations of existing methods. Additionally, aTypeError
withConnectionPatch
lines and a bug in thehist
method's line style specifiers are identified and resolved.
- Compiler and Debugger Compatibility Issues: The Matplotlib project encounters compatibility issues with compilers and debuggers. A strange internal compiler error occurs with GCC 15.0.1 during installation, related to bytecode stream and LTO processing. Additionally, a
TypeError
arises from an incompatibility between the pydevd debugger and Python 3.12, resolved by updating the pydevd version.
- CI Workflow and Package Version Management: The Matplotlib project's CI workflow and package version management require updates. The GitHub Actions CI
tests.yml
workflow needs cleanup by removing outdated version range restrictions for several Python packages. Additionally, the yanking ofpillow==11.2.0
due to a PyPI quota limit issue affects users, prompting a temporary solution.
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. Update lib/matplotlib/stackplot.py: This pull request aims to enhance the clarity of minimal examples in the stackplot.py
file of the Matplotlib library by updating and simplifying the code, as evidenced by multiple commits focused on rephrasing examples, removing trailing whitespaces, and collaborating with contributors.
- URL: pull/29853
- Merged: No
2. ENH: mpl_gui to main library: This pull request proposes integrating the mpl_gui
library, originally developed by @tacaswell, into the main Matplotlib library to facilitate a transition away from pyplot
and simplify certain backend hacks, while acknowledging the need for further code clarification, potential renaming, and future documentation enhancements.
- URL: pull/29836
- Merged: No
3. Fix loading of Type1 "native" charmap.: This pull request addresses the issue of loading the "native" charmap for Type1 fonts by directly reading and returning the encoding vector via FreeType's Type1-specific API, instead of relying on potentially unreliable heuristics, to ensure proper decoding of DVI files in usetex mode and to accommodate upcoming changes for {xe,lua}tex support.
- URL: pull/29843
- Merged: No
- Associated Commits: 1f4c2
Other Open Pull Requests
- GTK Tests in CI Workflow: This pull request addresses the issue of skipped GTK tests in the GitHub Actions CI workflow for Ubuntu 22.04. It restricts the version of
PyGObject
to ensure compatibility with the currently installedgirepository-1.0
, enhancing test coverage without requiring the newergirepository-2.0
.
- Enhancement to Pyplot Module: This pull request introduces an enhancement to Matplotlib's pyplot module. It allows users to register standalone figures with pyplot without initially creating them through pyplot, enabling more dynamic figure tracking and management.
- Backporting and Test Image Removal: This pull request involves backporting the first commit from PR #29827 to the v3.10.x branch. It focuses on removing unnecessary test images without implementing the API change related to
check_figures_equal
defaults, as it is deemed inappropriate for a bug fix release.
- Text Object Modification in Layout Tests: This pull request proposes an alternative approach by modifying the
Text
object in layout tests. It uses placeholders that draw rectangles instead of relying on specific font properties, ensuring consistent tests even when the font is changed.
- Error Handling in Pie Function: This pull request addresses issue #29860 by ensuring that the
pie()
function raises a clear value error message when non-finite values are passed as data. It includes a new test to verify this functionality.
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: 24
Key Closed Pull Requests
1. MNT: ci: MacOS: replace 'gobject-introspection' dependency with 'glib': This pull request addresses the replacement of the 'gobject-introspection' dependency with 'glib' in the MacOS continuous integration setup for the project, as the 'girepository' dependency has been migrated to 'glib', which is necessary to unblock upgrades of 'pygobject' and ensure the project remains up-to-date with the latest library updates and fixes.
- URL: pull/29777
- Merged: No
- Associated Commits: 38052, 84df7, b918c, 8ca03, 447dd, 1bfc1, daab6, c336d, 41c87, 6bb85, b965d, d17c6, 23ddc, e8873, 0c2f3, 52ee0, cd932, 69415, ad2c7, a1f84, 75247, da3a8, 8e067, 200fa, db282, f60e2, 472de, 6d41f, 9c806, d1af2
2. ci: Introduce ubuntu-24.04 to restore GTK test coverage with recent PyGObject versions: This pull request introduces Ubuntu 24.04 into the continuous integration testing workflow to restore GTK test coverage by addressing the unmet system dependency for girepository-2.0
required by recent versions of the PyGObject library, which is not available on Ubuntu 22.04, thereby improving test coverage for Linux GTK UI tests.
- URL: pull/29765
- Merged: 2025-04-01T03:04:33Z
- Associated Commits: 4d634, 6d159, 551b6, 07ef7, be61e, 5c0ef, f6410, 623d8, 43d63, 96398, 7eb9d, c7d66, a4587
3. Fix log scaling for pcolor and pcolormesh: This pull request addresses the issue of log scaling in the pcolor
and pcolormesh
functions in Matplotlib by passing all values to update_datalim
for appropriate handling, de-duplicating limit setting code, and ensuring consistent performance, with a slight slowdown observed in pcolormesh
but no significant impact on pcolor
.
- URL: pull/29783
- Merged: 2025-03-31T17:51:11Z
Other Closed Pull Requests
- Draggable Elements and Scroll Events: This topic addresses the issue of draggable elements being unintentionally moved during scroll events in the Matplotlib library. A custom picker for
DraggableBase
was implemented to prevent dragging when a scroll event is detected, resolving issue #29142 and superseding a previous attempt.
- Glyph Metrics Access: A new
get_metrics
method was introduced to access glyph metrics in a TrueType-compatible manner. This replaces the direct exposure of widths, heights, and depths dictionaries, preparing for support of {xe,lua}tex by using an alternative metrics-loading class.
- GitHub Actions Workflow Updates: Updates to the GitHub Actions
tests.yml
workflow include removing outdated version range restrictions and replacing the soon-to-be-unsupported Ubuntu 20.04 runner with Ubuntu 22.04. These changes ensure the latest package versions are used and maintain CI functionality.
- Interactive Figures Guide Improvements: The interactive figures guide was improved by reorganizing sections for better clarity and rephrasing content. These changes were backported to the v3.10.x and v3.10.1-doc branches to ensure consistency across versions.
- Test Image Redundancy Removal: Unnecessary test images were removed from the Matplotlib project by eliminating redundant tests for multiple file formats. This ensures that the remaining code is adequately tested without excess.
- Codebase Modernization for Python 3.11: The codebase was updated for compatibility with Python 3.11 using the
pyupgrade
tool. This modernization addresses legacy code issues, although it remains unmerged and depends on another pull request.
- Documentation Enhancements: Enhancements were made to the documentation related to the
plt.close()
function and other areas. These changes ensure compliance with the project's guidelines and were backported to the v3.10.x branch.
- Legend-Related Deprecations: Expired legend-related deprecations from previous issues were addressed by removing outdated code. This ensures the Matplotlib library remains up-to-date.
- Function Inlining for Readability: The function
_calc_extents_from_path
was inlined into its sole caller to enhance code readability. This eliminates the need for extensive documentation of its inputs and outputs.
- Render Clip Box Modification for 3D Plots: The render clip box for 3D plots was modified to encompass the entire figure rather than a square inset. This change addresses issues #19519 and #23450 and is targeted for milestone 3.11.0.
- Manager Instance Streamlining: The code was updated to use
Gcf.destroy(manager)
instead ofGcf.destroy(manager.num)
. This streamlines the process by directly passing a manager instance, avoiding potential confusion.
- Grammatical Error Correction: A grammatical error in the
lib\matplotlib\pyplot.py
file was corrected by changing "single a Axes" to "a single Axes" in a comment. This change does not introduce any functional code changes.
- Image Comparison Test Enhancement: An enhancement to the image comparison tests was proposed by introducing an option to replace text with bounding boxes. This offers a simplified approach when the exact characters are not crucial.
- Flake8 Version Pinning: Changes focusing on pinning the version of flake8 used in testing were backported to the v3.10.x and v3.10.1-doc branches. This ensures consistent testing environments across versions.
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 | 33 | 8 | 7 | 46 |
jayaddison | 53 | 5 | 7 | 28 |
anntzer | 15 | 8 | 2 | 23 |
dstansby | 26 | 6 | 2 | 12 |
QuLogic | 10 | 5 | 0 | 20 |
rcomer | 7 | 1 | 3 | 21 |
jklymak | 4 | 1 | 3 | 19 |
tacaswell | 3 | 0 | 0 | 15 |
story645 | 4 | 1 | 0 | 10 |
trygvrad | 11 | 0 | 0 | 0 |