Weekly GitHub Report for Matplotlib: February 17, 2025 - February 24, 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.0
1.2 Version Information:
Released on December 14, 2024, this version introduces preliminary support for free-threaded CPython 3.13, enhances accessibility with a new color cycle and dark-mode diverging colormaps, and improves 3D plotting capabilities with features like dynamic clipping and mouse rotation. Additionally, it includes updates such as exception handling control, new artistic elements like InsetIndicator and FillBetweenPolyCollection, and changes to subfigure handling and figure limits with the Agg renderer.
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]: improve the data structure of transformer pipeline base on the math structure of coordinate transformations: This issue proposes an enhancement to the data structure of the transformer pipeline in Matplotlib, aiming to align it with the mathematical structure of a group to improve performance by eliminating redundant structures during addition and subtraction operations. The suggested solution involves modifying the CompositeGenericTransform class to store transformers in a list rather than a nested structure, allowing for more efficient concatenation and simplification of transformers without altering the existing API.
- The comments discuss the feasibility and implications of the proposed changes, with concerns about maintaining the complete hierarchy of transformations and the potential complexity of implementing the changes. There is a suggestion to focus on optimizing existing caching mechanisms and using optimized versions of transformations where possible. The original poster provides a detailed explanation of their proposal, including the mathematical basis and potential simplification rules, but is asked to clarify the specific problem they aim to solve.
- Number of comments this week: 12
-
[Bug]: Markers with string-type integer values are converted to integers in cycler and matplotlibrc: This issue addresses a bug in the Matplotlib library where markers with string-type integer values are incorrectly converted to integers when using cycler and matplotlibrc, leading to unintended behavior. The problem is particularly evident when using lists like
["1", "2"]
, which are mistakenly treated as[1, 2]
, affecting various RcParams entries such as"lines.marker"
and"scatter.marker"
.- The comments discuss the root cause of the issue, which is related to the validation process that converts string integers to actual integers, and propose potential solutions such as separating conversion from validation and introducing full names for markers to avoid ambiguity. There is a consensus that the current validation approach needs re-evaluation, and suggestions include allowing for explicit type declarations in configuration files and possibly deprecating certain integer markers.
- Number of comments this week: 6
-
[Bug]: plot directive not handling indentation of long option strings: This issue addresses a bug in the plot directive of a GitHub project where long option strings, specifically alt text, are not being properly parsed, resulting in incorrect rendering of alt text in the output. The expected outcome is for the alt text to be correctly parsed and included in the HTML, but currently, it is not functioning as intended.
- The comments discuss potential solutions, including indenting the first line of the alt text and using a line continuation character, but these attempts did not resolve the issue. It is suggested that the problem might be with the sphinx/docutils parsing, and trying an
.. image::
directive is recommended to determine if the issue lies with docutils. - Number of comments this week: 4
- The comments discuss potential solutions, including indenting the first line of the alt text and using a line continuation character, but these attempts did not resolve the issue. It is suggested that the problem might be with the sphinx/docutils parsing, and trying an
-
[Bug]: pcolormesh's default x/y range might break
set_scale('log')
: This issue addresses a bug in thepcolormesh
function of Matplotlib, where setting the x- or y-scale to logarithmic can fail if the default axis limits include negative values. The proposed solution is to ensure that all axis limits are positive before applying the logarithmic scale to prevent this error.- The comments discuss the root cause of the issue, which is related to how
pcolormesh
infers cell edges, leading to negative values in the axis limits. Suggestions include explicitly setting positive limits before applying the log scale and a patch to update data limits based on positive edges. There is also a discussion on performance implications and handling sticky edges, with a consensus that the proposed patch improves the situation without significant performance drawbacks. - Number of comments this week: 3
- The comments discuss the root cause of the issue, which is related to how
-
[Bug]: I give an RGB image to imsave but I don't have the right color map!: This issue is about a bug in the Matplotlib library where the
imsave
function does not correctly handle RGB images provided as a list of lists of lists, resulting in an incorrect colormap being applied due to the absence of an RGB colormap. The user provides a code snippet to reproduce the issue, highlighting that the expected outcome is not achieved when saving the image, and seeks a solution to correctly save the image with the intended color components.- The comments discuss the source of the problem, suggesting the use of NumPy arrays instead of lists for better performance and correct handling of RGB images. Contributors provide code corrections and datatype suggestions to resolve the issue, while new contributors express interest in fixing the bug. A pull request is mentioned as being in progress to address the issue, and further contributions are currently not needed.
- Number of comments this week: 2
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]: Axes.cla() with sharex may wrongly reset the axes limit.: This issue describes a bug in the Matplotlib library where calling the
cla()
method on a subplot that shares the x-axis with another subplot incorrectly resets the x-axis limits to [0, 1], which is not the expected behavior. The problem arises because the_sharex
attribute of the subplot being cleared isNone
, leading to an unintended reset of the axis limits when the subplot is linked to another through shared axes. - prints from callbacks not forwarded to web browser when using ipympl: This issue highlights a problem where print statements from callbacks are not being forwarded to the web browser when using the ipympl backend in Jupyter, affecting the ability to capture mouse and click events. The user suggests that if this issue cannot be resolved, the documentation should at least specify which backends support these interactive features.
- [Bug]: Font fallback doesn't work on \mathdefault: This issue pertains to a bug in the Matplotlib library where the font fallback mechanism does not function correctly for tick labels when using the
\mathdefault
command, resulting in characters not covered by the primary font being rendered with placeholders instead of falling back to the secondary font. The problem specifically affects the rendering of certain Unicode characters, such as the minus sign and times sign, in tick labels, while other text instances correctly utilize the fallback font. - [DOC]: clarify that
markevery[float]
considers path length along drawn line: This issue addresses a problem with themarkevery[float]
parameter in Matplotlib, where it is expected to distribute markers evenly along a plotted line, but its effectiveness diminishes when the y-data is noisy. The user provides a code example demonstrating the issue, where the markers are not evenly distributed across subplots with varying noise levels, contrary to the expected outcome where all subplots should resemble the one with zero noise. - [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.
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:
- Enhancements to Matplotlib Functions: This topic covers proposed improvements to various Matplotlib functions to enhance usability and performance. One issue suggests aligning the transformer pipeline with a mathematical group structure to improve performance by eliminating redundant structures. Another proposes adding a feature to the
bar_label
function to allow for individual padding adjustments to prevent label overlap.
- Bugs in Matplotlib: Several issues highlight bugs affecting Matplotlib's functionality and output. One bug involves incorrect conversion of string-type integer markers, causing discrepancies in RcParams entries. Another bug affects the plot directive's handling of long option strings, leading to improper rendering of alt text in HTML output.
- Inconsistencies and Performance Issues: This topic addresses inconsistencies and performance problems within Matplotlib. An inconsistency in the 'step' argument between
fill_between
andplot
functions is noted, with a proposal to align them by addingdrawstyle
arguments. Additionally, a performance issue withfont_manager.findSystemFonts
on macOS is identified, suggesting a manual search within font directories to improve execution time.
- Animation and Attribute Errors: Issues related to animation and attribute errors in Matplotlib are discussed. One issue describes an
Animation
object unnecessarily restarting after being saved, due to automatic start detection without a clear API for managing states. Another issue involves an AttributeError related to the 'dedent_interpd' attribute when using Herbie, which previously worked in an earlier version.
- Marker Naming and Readability: An enhancement is proposed to improve code readability by supporting long descriptive names for markers, such as "circle" instead of "o". This change aims to facilitate the deprecation of integer markers while maintaining the current single-character marker syntax for the
fmt
string in theplot()
function.
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 Bugs with
imshow()
and Transparency: A bug in the Matplotlib library occurs when usinginterpolation_stage="rgba"
with theimshow()
function, causing array-valued alpha transparency settings to be ignored. This results in inconsistent image rendering compared to wheninterpolation_stage="alpha"
is used.
- AttributeError in Matplotlib with Outdated Pandas: An
AttributeError
is raised when creating a plot with two lines in Matplotlib due to the 'Legend' object lacking the 'legendHandles' attribute. The issue was traced back to using an outdated version of pandas (1.5.3) instead of the current version (2.2.3).
- KeyError in Interactive Plots with IPython: A
KeyError: 'buttons'
occurs when hovering over an interactive plot in IPython using Matplotlib. This issue was identified as a duplicate of a previously fixed problem and resolved in the ipympl 0.9.6 release, although some users needed to restart their kernel to see the fix.
- Formatting Tick Labels on Matplotlib Colorbar: A user sought help to format tick labels on a colorbar in a Matplotlib plot, aiming to display "0" and "1.934" instead of the default "0.000" and "1.934". After trying various methods, they received a solution involving setting tick labels separately from tick positions.
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: 7
Key Open Pull Requests
1. Feature: Added setter/getter methods for missing kwargs in Figure.init: This pull request introduces setter and getter methods for the figsize
and subplotpars
parameters in the Figure.__init__
method to address the issue #24617, ensuring consistency with the fig.set()
method, and includes tests to verify the functionality of these additions.
- URL: pull/29638
- Merged: No
- Associated Commits: a8281fe25a8629966603c637c0993b8cde107f54, e2669ce997415cda4a648860dc8bd50c1d9bb025
2. Fixed Dynamic Column: This pull request addresses the optimization of dynamic column calculation in the Matplotlib project by introducing a new function that dynamically selects the optimal column count to improve symbol distribution, spacing, and readability, replacing the previous method that used a fixed column count and resulted in uneven layouts.
- URL: pull/29640
- Merged: No
- Associated Commits: 6df7587ab9c0541e484878d676104e0646f0ae9f, 3c3f04c165b814137f2a6eaceaf9f4c427138471
3. Added elif for taking NumPy Array for imsave: This pull request addresses issue #29183 by adding an elif statement to the imsave
function in the Matplotlib library, ensuring that 3D NumPy arrays representing RGB(A) images bypass unnecessary colormap transformations, thus correctly handling both grayscale and RGB(A) image inputs.
- URL: pull/29641
- Merged: No
- Associated Commits: 39368110191a983db9828dd0f3872cec7e46b154
Other Open Pull Requests
- Hatch API Documentation Enhancements: This pull request adds images of hatches to the hatch API documentation page in the Matplotlib project. It addresses and closes issue #27196 and includes a new hatch mpl_type that links to the API page, with the intention of eventually creating a dedicated page for hatches similar to the existing color documentation.
- Colorbar Class Documentation Reorganization: This pull request aims to reorganize the documentation of the Colorbar class in the Matplotlib project. It moves its parameters to the
__init__
method, thereby preventing the numpydoc tool from incorrectly inserting "Attributes" between "Parameters" and "Other Parameters."
- Figure Legend Demo Example Revision: This pull request involves revising the Figure Legend Demo Example in the Matplotlib documentation. It elaborates on the differences between the 'outside left upper' and 'outside upper right' legend locations.
- Documentation Update for Marginal Scatter Plots: This pull request proposes updating the documentation by replacing the use of
add_gridspec
and multipleadd_subplot
calls withsubplot_mosaic
. It aims to simplify the process and reduce the need for users to utilize gridspec.
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. Respect array alpha with interpolation_stage='rgba' in _Imagebase::_make_image: This pull request addresses the issue of ensuring that the array alpha is respected in the _Imagebase::_make_image
function when the interpolation_stage
parameter is set to 'rgba', thereby closing issue #28382 on the Matplotlib GitHub repository.
- URL: pull/28437
- Merged: Yes
- Associated Commits: c6caa3d8bd134ea093131a747fa4c1b0f74e8066, 211db94436b1b9abdee4b9fe221fc12752816749, 1e07a733fe6776123a35349df959679407800ec9, a1247ce6d128b2931755cbedc48431a01a8e0e08, 8a032c11a5d037a8f28f80990acda011fc946e66
2. Add get_data and get_array to _ImageBase: This pull request introduces the get_data
and get_array
methods to the _ImageBase
class in the Matplotlib library to enhance consistency, with plans to potentially deprecate the set_array
and get_array
methods in future versions, and it addresses issue #28929.
- URL: pull/28940
- Merged: No
- Associated Commits: b90fe40008bef6899e3756eeea65b3bc6fe0d443, c744e1f782e95df38b88410ef1737d638e3ad07f, 9ec02f942c414e8835e9898f95405f11c82999d2, b5c6375696cacbc3379406df6d0e93eaef390982
3. DOC: Add docstrings to get_usetex and set_usetex in ticker.py: This pull request adds detailed docstrings to the get_usetex
and set_usetex
functions in the ticker.py
file of the Matplotlib project, clarifying their roles in enabling and setting the use of TeX's math mode for rendering, while also cleaning up excessive whitespaces and incorporating feedback from a co-author.
- URL: pull/29642
- Merged: Yes
- Associated Commits: 255a2126bf2bc385d8144e9b6e90e4fdc100ac0a, ef33787a0413fffb9580434c3515e0dab6e8ad15, 35f04572e7e929cbd003d3be90a8622950f8ac85, 48d90c2bcf6b18893d4c4cc5e1fae2e4dfab7230
Other Closed Pull Requests
- Bug Fixes and Improvements in Documentation: This topic includes updates to broken links, bug fixes, and documentation improvements in the Matplotlib project. Pull requests addressed issues such as updating old links to correct URLs, fixing bugs in
test_image.py
andbackend_webagg_core
, and adding xaxis and yaxis attributes to the Axes documentation.
- Backporting Changes: Several pull requests focused on backporting changes to different branches of the Matplotlib project. These included backporting updates to the v3.10.x and v3.10.0-doc branches, such as reordering keyword-only arguments in the Colorbar component and adding xaxis and yaxis attributes to the Axes documentation.
- Copy-Editing and Code Style Updates: This topic covers improvements in code style and documentation formatting within the Matplotlib project. Pull requests involved harmonizing quotation and spacing styles, fixing indentation in example code, and updating method names to align with current library standards.
- New Features and Enhancements: This topic includes the introduction of new features and enhancements to the Matplotlib library. A notable pull request introduced a context manager to the default figure class returned by
plt.figure()
, aiming to facilitate interactions with other libraries by managing the closure of figures.
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 | 20 | 5 | 105 |
story645 | 7 | 3 | 1 | 73 |
anntzer | 9 | 7 | 2 | 19 |
rcomer | 10 | 4 | 1 | 17 |
QuLogic | 11 | 2 | 0 | 19 |
meeseeksmachine | 0 | 31 | 0 | 0 |
jklymak | 1 | 1 | 0 | 27 |
star1327p | 20 | 4 | 0 | 4 |
tacaswell | 6 | 1 | 0 | 20 |
scottshambaugh | 11 | 1 | 2 | 13 |