Skip to content

Use format_data_short to format image cursor data. #13684

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
Mar 17, 2019

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Mar 17, 2019

Despite its name, format_data_short is actually used to format the x/y
cursor data; it makes sense to also use it for image data. By doing so,
e.g. for imshow([[.123, .987]]), one gets the more accurate .123
string when the mouse is over the first pixel instead of .1 that
__call__ returns (which would have been intended as a tick label).

Release critical as an improvement over #12459.

PR Summary

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

Despite its name, format_data_short is actually used to format the x/y
cursor data; it makes sense to also use it for image data.  By doing so,
e.g. for `imshow([[.123, .987]])`, one gets the more accurate `.123`
string when the mouse is over the first pixel instead of `.1` that
`__call__` returns (which would have been intended as a tick label).
@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Mar 17, 2019
@anntzer anntzer added this to the v3.1.0 milestone Mar 17, 2019
@timhoffm timhoffm merged commit 20a409c into matplotlib:master Mar 17, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 17, 2019
@anntzer anntzer deleted the format_cursor_data branch March 17, 2019 20:05
timhoffm added a commit that referenced this pull request Mar 17, 2019
…684-on-v3.1.x

Backport PR #13684 on branch v3.1.x (Use format_data_short to format image cursor data.)
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.

3 participants