-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: format_image_data on an image of only zeros produces a large number of zeros #28648
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
Labels
Milestone
Comments
The issue is singular norms. We do a bunch of extra logic it matplotlib/lib/matplotlib/artist.py Lines 1349 to 1377 in adb97e8
matplotlib/lib/matplotlib/cbook.py Lines 2249 to 2267 in adb97e8
I have some ideas, will open a PR shortly. |
tacaswell
added a commit
to tacaswell/matplotlib
that referenced
this issue
Aug 2, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug summary
If you use imshow, and then mouseover the image, the value is listed at the bottom of the plot.
However, if the image contains only zeros, the result is a comical number of zeros.
Code for reproduction
Actual outcome
When you mouse-over the image it shows a large number of zeros (see bottom of image).

Expected outcome
0.0 should be at the bottom of the page and the window should retain its original size:

Additional information
test_image.py→test_image_cursor_formatting() should test this perscise functionality, but there is a bug in this test where
should be
And this causes
im.format_cursor_data
to fallback and '0' is returned.This test should be updated as part of a PR to fix this bug.
Operating system
No response
Matplotlib Version
matplotlib_dev, 3.8.2
Matplotlib Backend
TkAgg
Python version
No response
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: