Return the number of significant digits to %g-format *value*, assuming that
it is known with an error of *delta*.
"""
if delta == 0:
if value == 0:
# if both value and delta are 0, np.spacing below returns 5e-324
# which results in rather silly results
return 3
# delta = 0 may occur when trying to format values over a tiny range;
# in that case, replace it by the distance to the closest float.
> delta = abs(np.spacing(value))
^^^^^^^^^^^^^^^^^
E RuntimeWarning: invalid value encountered in spacing
lib\matplotlib\cbook.py:2238: RuntimeWarning
Possibly related to the numpy 2.3 release from yesterday.
Bug summary
https://dev.azure.com/matplotlib/matplotlib/_build/results?buildId=44174&view=logs&j=c0a65fc6-a4f7-5116-4cee-beb3104aaa7c&t=ccc2daa7-0687-5084-0ea1-0e98a3640679&l=239
Possibly related to the numpy 2.3 release from yesterday.
Code for reproduction
-Actual outcome
Expected outcome
Additional information
No response
Operating system
No response
Matplotlib Version
Main
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None