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
AttributeError: 'float' object has no attribute 'deg2rad' #13286
Traceback (most recent call last):
File "../../pie_np.py", line 9, in <module>
axis.pie(x, labels=['a0', 'a1', 'a2', 'a3'], colors=['#ff0000','#ccff00','#00ff66','#0066ff'])
File "/usr/lib/python3.7/site-packages/matplotlib/__init__.py", line 1810, in inner
return func(ax, *args, **kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 2854, in pie
**wedgeprops)
File "/usr/lib/python3.7/site-packages/matplotlib/patches.py", line 1041, in __init__
self._recompute_path()
File "/usr/lib/python3.7/site-packages/matplotlib/patches.py", line 1053, in _recompute_path
arc = Path.arc(theta1, theta2)
File "/usr/lib/python3.7/site-packages/matplotlib/path.py", line 862, in arc
eta1, eta2 = np.deg2rad([eta1, eta2])
AttributeError: 'float' object has no attribute 'deg2rad'
It's ok if I use x = [0.4, 0.3, 0.2, 0.1] or go back to numpy 1.15.4
My gut feeling is that even if we do temporarily fix this (i.e. work around the bad interaction between numpy 1.16 and mpl, which is probably just a matter of squeeze()ing the inpût), we should take that opportunity to deprecate support for 2D input here (essentially like in may other places (errorbar(), scatter()), where we interpret 2D "column" inputs as 1D inputs (likely due to MATLAB heritage) but that behavior is simply not consistent with numpy's general broadcasting rules); see #13209 for a similar case.
Activity
anntzer commentedon Jan 25, 2019
My gut feeling is that even if we do temporarily fix this (i.e. work around the bad interaction between numpy 1.16 and mpl, which is probably just a matter of squeeze()ing the inpût), we should take that opportunity to deprecate support for 2D input here (essentially like in may other places (errorbar(), scatter()), where we interpret 2D "column" inputs as 1D inputs (likely due to MATLAB heritage) but that behavior is simply not consistent with numpy's general broadcasting rules); see #13209 for a similar case.
jschueller commentedon Jan 26, 2019
Ok, I'll change our code too then.
Viewer: Dont use matplotlib 2-d input
Viewer: Dont use matplotlib 2-d input
Viewer: Dont use matplotlib 2-d input