X Tutup
Skip to content

Fix dicts unpacking for .plot#17506

Merged
tacaswell merged 5 commits intomatplotlib:masterfrom
story645:fix-dicts
May 25, 2020
Merged

Fix dicts unpacking for .plot#17506
tacaswell merged 5 commits intomatplotlib:masterfrom
story645:fix-dicts

Conversation

@story645
Copy link
Copy Markdown
Member

@story645 story645 commented May 25, 2020

PR Summary

d = {4:1, 6:2}
plt.plot(d.keys(), d.values())

is supposed to work & then stopped working because of changes to how .plot processes the data kwarg (#10928). This PR takes the dead simple approach of running the args to .plot through sanitize_sequence since it's a pass through function, but there's probably a better way.

Also added a bunch of tests to hopefully catch this. I think this is release critical since it worked in 3.0 and broke in 3.1, but on the other hand I only noticed this 'cause I wanted to update some docs (that actually should have been fine even w/o the fix 🙃)

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@story645 story645 changed the title Fix dicts Fix dicts unpacking for .plot May 25, 2020
@story645 story645 added this to the v3.3.0 milestone May 25, 2020
@story645 story645 added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label May 25, 2020
@story645 story645 linked an issue May 25, 2020 that may be closed by this pull request
@tacaswell tacaswell merged commit fcb0a41 into matplotlib:master May 25, 2020
@story645 story645 deleted the fix-dicts branch October 6, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dict unpacking broken for .plot in 3.2

3 participants

X Tutup