Title: [Bug] set_3d_properties type error in Matplotlib 3.5.1 · Issue #22308 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug] set_3d_properties type error in Matplotlib 3.5.1 · Issue #22308 · matplotlib/matplotlib
X Title: [Bug] set_3d_properties type error in Matplotlib 3.5.1 · Issue #22308 · matplotlib/matplotlib
Description: Bug summary I had a code that uses animation.FuncAnimation to generate an animation, where I update a mpl_toolkits.mplot3d.art3d.Line3D object using set_data(a, b) and set_3d_properties(c) where a, b, and c are of type numpy.float64. Thi...
Open Graph Description: Bug summary I had a code that uses animation.FuncAnimation to generate an animation, where I update a mpl_toolkits.mplot3d.art3d.Line3D object using set_data(a, b) and set_3d_properties(c) where a,...
X Description: Bug summary I had a code that uses animation.FuncAnimation to generate an animation, where I update a mpl_toolkits.mplot3d.art3d.Line3D object using set_data(a, b) and set_3d_properties(c) where a,...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/22308
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug] set_3d_properties type error in Matplotlib 3.5.1","articleBody":"### Bug summary\r\nI had a code that uses `animation.FuncAnimation` to generate an animation, where I update a `mpl_toolkits.mplot3d.art3d.Line3D` object using `set_data(a, b)` and `set_3d_properties(c)` where `a`, `b`, and `c` are of type `numpy.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\r\n```bash\r\n File \"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/mpl_toolkits/mplot3d/art3d.py\", line 175, in set_3d_properties\r\n zs = np.broadcast_to(zs, len(xs))\r\nTypeError: object of type 'numpy.float64' has no len()\r\n```\r\n\r\n### Source\r\nI checked the source code of `mpl_toolkits/mplot3d/art3d.py` and found that in Matplotlib 3.4.3, line 175 (the line where the error occurred) was `zs = 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 to `set_data([a], [b])` and `set_3d_properties([c])`, but as expected, this would not run in 3.4.3. I am using Python 3.10.\r\n\r\nWas this change in line 175 of `mpl_toolkits/mplot3d/art3d.py` intended?\r\n","author":{"url":"https://github.com/jiashuhan","@type":"Person","name":"jiashuhan"},"datePublished":"2022-01-24T23:30:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":21},"url":"https://github.com/22308/matplotlib/issues/22308"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:774d38ff-d97d-fd4c-e570-48c3089c34c9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6D8:12E3C6:701D03:9400E2:6A518EBB |
| html-safe-nonce | 7a2aa346ecf9d5e93b20c6a3192bf0ae243f2ddb136974bb700c274cde4449f6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkQ4OjEyRTNDNjo3MDFEMDM6OTQwMEUyOjZBNTE4RUJCIiwidmlzaXRvcl9pZCI6IjU2NTUyMTkxNzAyNTk4NjUyNzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cd34a281ad69a7cdf519d5e566bee686901bb768deff4be665e2f1cff33d9fde |
| hovercard-subject-tag | issue:1113255069 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/22308/issue_layout |
| twitter:image | https://opengraph.githubassets.com/29eb22ce8b3453d1e6eb1bb79e60b878f2fe97d6f5f177b0f1126b27a42058b1/matplotlib/matplotlib/issues/22308 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/29eb22ce8b3453d1e6eb1bb79e60b878f2fe97d6f5f177b0f1126b27a42058b1/matplotlib/matplotlib/issues/22308 |
| og:image:alt | Bug summary I had a code that uses animation.FuncAnimation to generate an animation, where I update a mpl_toolkits.mplot3d.art3d.Line3D object using set_data(a, b) and set_3d_properties(c) where a,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jiashuhan |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width