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

Skip to content

Disable QuadMesh cursor data by default #22254

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 20, 2022

Conversation

dstansby
Copy link
Member

PR Summary

For moderately sized QuadMeshes getting the cursor data is very slow - see #21917 (comment). As such, disable by default for now, but allow users to manually enable it.

Fixes #22253
Fixes #21917

PR Checklist

Tests and Styling

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

Documentation

  • New features are documented, with examples if plot related.
  • 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).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@dstansby dstansby added this to the v3.5.2 milestone Jan 17, 2022
@dstansby dstansby requested a review from anntzer January 17, 2022 19:59
@dstansby dstansby added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jan 17, 2022
@@ -1934,6 +1934,12 @@ class QuadMesh(Collection):

shading : {'flat', 'gouraud'}, default: 'flat'

Attributes
----------
show_cursor_data : bool
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a comparable API on anything else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Searching the docs for cursor_data suggests we don't.

Copy link
Member

Choose a reason for hiding this comment

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

Do we want to make this a general Artist API, and set as appropriate for different artists (like set_snap, set_in_layout, etc)?

Copy link
Member Author

Choose a reason for hiding this comment

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

This sounds like a good idea, but maybe not for a bugfix release.

@anntzer
Copy link
Contributor

anntzer commented Jan 18, 2022

I agree the slowness isn't really acceptable. No strong opinion as to the exact control API (well, perhaps a vague preference for a setter/getter for API consistency, but heh).

@dstansby
Copy link
Member Author

No strong opinion as to the exact control API (well, perhaps a vague preference for a setter/getter for API consistency, but heh).

Do we have any general policy or preference for attribute vs. property vs. getter/setter? I'm also open to any, but attribute was the fewest lines of code to implement 😄

@anntzer
Copy link
Contributor

anntzer commented Jan 18, 2022

I don't know policy-wise, but the statu quo would certainly be a setter.

@tacaswell tacaswell merged commit 0406c46 into matplotlib:main Jan 20, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 20, 2022
QuLogic added a commit that referenced this pull request Jan 20, 2022
…254-on-v3.5.x

Backport PR #22254 on branch v3.5.x (Disable QuadMesh cursor data by default)
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.

pcolormesh freezes window when zooming/panning [Bug]: pcolormesh is not responsive in Matplotlib 3.5
5 participants