Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
I had a code that usesanimation.FuncAnimation
to generate an animation, where I update ampl_toolkits.mplot3d.art3d.Line3D
object usingset_data(a, b)
andset_3d_properties(c)
wherea
,b
, andc
are of typenumpy.float64
. This code works perfectly in Matplotlib 3.4.3. However, after I upgraded to Matplotlib 3.5.1, it fails with the following error
File"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mpl_toolkits/mplot3d/art3d.py", line 175,in set_3d_properties zs = np.broadcast_to(zs, len(xs))TypeError: object oftype'numpy.float64' has nolen()
Source
I checked the source code ofmpl_toolkits/mplot3d/art3d.py
and found that in Matplotlib 3.4.3, line 175 (the line where the error occurred) waszs = np.broadcast_to(zs, xs.shape)
instead, and this avoids the error. I was able to make my code run again in Matplotlib 3.5.1 by changing my code toset_data([a], [b])
andset_3d_properties([c])
, but as expected, this would not run in 3.4.3. I am using Python 3.10.
Was this change in line 175 ofmpl_toolkits/mplot3d/art3d.py
intended?