-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Refactor of hexbin for 3.6.0 crashes with empty arrays and log scaling #23922
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
Comments
bisects to: #21989 |
Ah, so it seems that the change from I don't know what the correct solution is; is it as simple as putting a guard in |
I suspect adding that guard is the right thing to do. It is impossible to correctly autoscale with no data so it is a bit of an undefined operation. In this case doing anything is better than crashing. It would be best if we still maintained the old behavior. |
Putting in a guard (hacking my installation and not running a full test) does work in terms of not crashing, but leaves the hexbin (in particular) with no background rather than the default bluish background. I'm not sure if this is a problem, but it is different from the previous behavior (and the behavior without log scaling), but I don't know what the default values of vmin and vmax used to be in this case. |
Closed by #23944. |
Bug summary
With 3.5 and previously, doing hexbin with empty arrays and log scaling just produced an empty plot. With 3.6.0 it crashes.
Code for reproduction
Actual outcome
...
File ~/miniforge3/envs/mpl36/lib/python3.10/site-packages/numpy/core/_methods.py:44, in _amin(a, axis, out, keepdims, initial, where)
42 def _amin(a, axis=None, out=None, keepdims=False,
43 initial=_NoValue, where=True):
---> 44 return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity
Expected outcome
It just runs and then a
plt.show()
gives an empty rectangle.Additional information
No response
Operating system
macos arm64
Matplotlib Version
3.6.0
Matplotlib Backend
MacOSX
Python version
3.10
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: