New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: array-like linewidth raises an error for scatter3D #23433
Comments
The conversion to matplotlib/lib/matplotlib/collections.py Lines 566 to 583 in 386d615
which gets called via matplotlib/lib/mpl_toolkits/mplot3d/art3d.py Lines 563 to 566 in 0d433b4
More specifically, the call to matplotlib/lib/matplotlib/collections.py Line 691 in 386d615
The safest solution would be to cast to numpy array in |
Bug summary
The documentation says that
linewidths
can befloat or array-like
and it defaults to 1.5, but passing an array-like leads to an errorCode for reproduction
Actual outcome
Exception:
gets raised, from:
matplotlib/lib/mpl_toolkits/mplot3d/art3d.py
Lines 599 to 603 in 0d433b4
This is because the type of
self._sizes3d
isnumpy.ndarray
, but type ofself._linewidths3d
islist
.Expected outcome
Array-like linewidth works for 3d plots as it does for 2d plots.
Additional information
ax.scatter(x, x, x, marker='o', s=x)
works fine.linewidths
is a list regardless of user input type.np.array
call:self._linewidths = np.array(self._linewidths3d)[z_markers_idx]
(tested that this fixes the issue).Operating system
No response
Matplotlib Version
3.5.2 but also happens with older versions (3.3.x)
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: