You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Log Scale: FloatingPointError: underflow encountered in power #15331
When setting the scale to log on an empty axis while having numpy error handling set to raise, a FloatingPointError is thrown. When plotting data beforehand, everything works fine.
This is an issue for me, because I'm trying to plot multiple subplots with shared y axes after each other, where this issue occurs as well. For some reason in that context the error handling seems to bet set to raise.
Issue #4285 is related but the stack trace is different and this issue is not dependent on data.
Traceback (most recent call last):
File ".../.PyCharmCE2019.2/config/scratches/scratch_44.py", line 7, in <module>
plt.yscale("log")
File ".../venv/lib/python3.6/site-packages/matplotlib/pyplot.py", line 3088, in yscale
return gca().set_yscale(value, **kwargs)
File ".../venv/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 3711, in set_yscale
self.autoscale_view(scalex=False)
File ".../venv/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2498, in autoscale_view
'minposy', self.yaxis, self._ymargin, y_stickies, self.set_ybound)
File ".../venv/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2486, in handle_single_axis
x0, x1 = inverse_trans.transform([x0t, x1t])
File ".../venv/lib/python3.6/site-packages/matplotlib/transforms.py", line 1394, in transform
res = self.transform_affine(self.transform_non_affine(values))
File ".../venv/lib/python3.6/site-packages/matplotlib/scale.py", line 334, in transform_non_affine
return ma.power(self.base, a)
File ".../venv/lib/python3.6/site-packages/numpy/ma/core.py", line 6717, in power
result = np.where(m, fa, umath.power(fa, fb)).view(basetype)
FloatingPointError: underflow encountered in power
Activity
anntzer commentedon Sep 26, 2019
This is fixed by #15258.