Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug] set_3d_properties type error in Matplotlib 3.5.1 #22308

Closed
@jiashuhan

Description

@jiashuhan

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp