GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow Python native sequences in Matplotlib `imsave()`. by guillermodotn · Pull Request #29931 · matplotlib/matplotlib

Conversation

@guillermodotn

@guillermodotn guillermodotn commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

PR summary

This PR addresses issue #29183 by casting Python sequence types (e.g., lists or tuples) to NumPy arrays during the image saving process.

The implementation is inspired by PR #29203 by @gpxxlt, which currently appears to be on hold.

PR checklist

  • "closes #0000" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • [ N/A ] Plotting related features are demonstrated in an example
  • [ N/A ] New Features and API Changes are noted with a directive and release note
  • [ N/A ] Documentation complies with general and docstring guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

NGWi reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@guillermodotn @gpxxlt
Allow Python native sequences in Matplotlib imsave.
fb0c9ac
Co-authored-by: Yuepeng Gu <[email protected]>
@github-actions github-actions Bot added the topic: images label Apr 16, 2025
github-actions[bot]
github-actions Bot reviewed Apr 16, 2025
View reviewed changes

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@guillermodotn guillermodotn mentioned this pull request Apr 16, 2025
[Bug]: I give an RGB image to imsave but I don't have the right color map! #29183
Closed
tacaswell
tacaswell approved these changes Apr 17, 2025
View reviewed changes
@tacaswell tacaswell added this to the v3.10.2 milestone Apr 17, 2025
ksunden
ksunden approved these changes Apr 17, 2025
View reviewed changes
@ksunden
ksunden merged commit 6d98336 into matplotlib:main Apr 17, 2025
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 17, 2025
@ksunden @meeseeksmachine
Backport PR matplotlib#29931: Allow Python native sequences in Matplo…
9a57241
…tlib `imsave()`.
@meeseeksmachine meeseeksmachine mentioned this pull request Apr 17, 2025
Backport PR #29931 on branch v3.10.x (Allow Python native sequences in Matplotlib imsave().) #29933
Merged
@QuLogic

QuLogic commented Apr 18, 2025

Copy link
Copy Markdown
Member

Why did ruff not catch the style errors here (which the backport did since it's still using flake8)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@guillermodotn

guillermodotn commented Apr 18, 2025

Copy link
Copy Markdown
Contributor Author

Why did ruff not catch the style errors here (which the backport did since it's still using flake8)?

It seems the rule E302 is not enforced in pyproject.toml, as seen here.

According to the Ruff documentation, this rule is currently marked as unstable, so Matplotlib doesn’t appear to make use of it at the moment.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@QuLogic QuLogic mentioned this pull request Apr 22, 2025
Fixed imsave() saving incorrect color map #29203
Closed
2 of 5 tasks
@ksunden ksunden mentioned this pull request May 9, 2025
merge up 3.10.3 #30031
Closed
5 tasks
@ksunden ksunden mentioned this pull request Jul 25, 2025
Manual Backport PR #30195 on branch v3.10.x (ci: Enable wheel builds on Python 3.14) #30356
Merged
5 tasks
@ksunden ksunden mentioned this pull request Aug 7, 2025
merge up v3.10.5 #30401
Merged
5 tasks
@timhoffm timhoffm mentioned this pull request Aug 21, 2025
Added elif for taking NumPy Array for imsave #29641
Closed
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@github-actions github-actions[bot] github-actions[bot] left review comments
@tacaswell tacaswell tacaswell approved these changes
@ksunden ksunden ksunden approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic: images

Projects

None yet

Milestone

v3.10.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@guillermodotn @QuLogic @tacaswell @ksunden
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.