Closed
Description
Bug summary
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.
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
Metadata
Metadata
Assignees
Labels
No labels