Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add interactive colorbar example to gallery #20471

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 5 commits into from
Jul 21, 2021

Conversation

richardsheridan
Copy link
Contributor

@richardsheridan richardsheridan commented Jun 19, 2021

PR Summary

Added an example to the gallery for discussion regarding #19515. All that needs to happen in each event is to modify the colorbar norm vmin and vmax, although the particular interactivity that was desired in #19515 would require a little more creativity in the callbacks.

Hoping for feedback as to:

  1. whether to actually include in gallery
  2. style of new gallery page
  3. code review

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@timhoffm
Copy link
Member

BTW thanks for taking the time to put this example together!

@richardsheridan
Copy link
Contributor Author

I feel #20479 blocks this PR so marking as draft until resolved.

@richardsheridan
Copy link
Contributor Author

Also something about the new ColorbarAxes detaches the mouse event xdata and ydata from the data range, so this only coincidentally worked since the range of the data was 0..1, another blocker.

@richardsheridan richardsheridan marked this pull request as ready for review July 8, 2021 14:20
@richardsheridan
Copy link
Contributor Author

Unblocked by #20501, thanks for everyone's help there! (Somehow I didn't get any notifications about that PR?)

@timhoffm
Copy link
Member

timhoffm commented Jul 8, 2021

flake8:

./examples/userdemo/colormap_interactive_adjustment.py:51:80: E501 line too long (87 > 79 characters)

@jklymak
Copy link
Member

jklymak commented Jul 21, 2021

Maybe I'm doing something wrong, but this only works for one click for me and then the colorbar stops responding. Is that expected, or am I doing something wrong?

@jklymak jklymak merged commit 4fdff43 into matplotlib:master Jul 21, 2021
@jklymak
Copy link
Member

jklymak commented Jul 21, 2021

Thanks!

@richardsheridan richardsheridan deleted the interactive_colorbar branch July 21, 2021 02:00
@QuLogic QuLogic added this to the v3.5.0 milestone Jul 21, 2021
@richardsheridan richardsheridan mentioned this pull request Sep 27, 2021
7 tasks
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.

4 participants