Skip to content

Stop sorting artists in Figure Options dialog #22208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jan 12, 2022

PR Summary

With #18216, the order that artists are added to an Axes is their canonical order. The dialog should not be sorting them in some other manner.

Additionally, this fixes a bug in that apply_callback indexes back to the original list, which means that changes will be made to the wrong artist if sorting actually occurred. It also makes the legend almost entirely wrong as well.

See https://discourse.matplotlib.org/t/bug-on-re-generate-automatic-legend-of-matplotlib-figure-property/22511

PR Checklist

Tests and Styling

  • [n/a] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [n/a] New features are documented, with examples if plot related.
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).

With matplotlib#18216, the order that artists are added to an Axes is their
canonical order. The dialog should not be sorting them in some other
manner.

Additionally, this fixes a bug in that `apply_callback` indexes back to
the original list, which means that changes will be made to the *wrong*
artist if sorting actually occurred. It also makes the legend almost
entirely wrong as well.

See https://discourse.matplotlib.org/t/bug-on-re-generate-automatic-legend-of-matplotlib-figure-property/22511
@tacaswell tacaswell merged commit a5e3e32 into matplotlib:main Jan 12, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 12, 2022
timhoffm added a commit that referenced this pull request Jan 12, 2022
…208-on-v3.5.x

Backport PR #22208 on branch v3.5.x (Stop sorting artists in Figure Options dialog)
@QuLogic QuLogic deleted the no-figopt-sorting branch January 12, 2022 20:44
@tacaswell tacaswell linked an issue Apr 11, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Changing Linestyle in plot window swaps some plotted lines
3 participants