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
[Bug]: ValueError: The truth value... when an ndarray is passed to the color kwarg of axes3d.scatter #26821
Passing a numpy array to the color argument of ax.scatter results in a ValueError when ax is initialized with projection='3d'. This error began occurring in our CI after the release of matplotlib 3.8.0.
NB: This is legacy code I'm maintaining but haven't actually written myself -- I only began looking at it after our CI threw an error after the upgrade from matplotlib 3.7.3 to 3.8.0.
If I remove projection='3d', the code does not error out.
If I pass a list ([0, 0, 0, 1]) rather than an ndarray, the code does not error out, and displays a black, opaque point:
c Defaults to None. In that case the marker color is determined by the value of color, facecolor or facecolors. In case those are not specified or None, the marker color is determined by the next color of the Axes' current "shape and fill" color cycle.
This issue is suited to new contributors because it does not require understanding of the Matplotlib internals. To get started, please see our contributing guide.
We do not assign issues. Check the Development section in the sidebar for linked pull requests (PRs). If there are none, feel free to start working on it. If there is an open PR, please collaborate on the work by reviewing it rather than duplicating it in a competing PR.
Activity
ksunden commentedon Sep 18, 2023
This behavior was changed in #26249
I think that the conditional should actually be:
as it is using
.getreally only to determine if it is present or not.timhoffm commentedon Sep 19, 2023
I think the condition actually should be
To make explicit color=None work and comply with
from https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.scatter.html#matplotlib.axes.Axes.scatter
github-actions commentedon Sep 19, 2023
Good first issue - notes for new contributors
This issue is suited to new contributors because it does not require understanding of the Matplotlib internals. To get started, please see our contributing guide.
We do not assign issues. Check the Development section in the sidebar for linked pull requests (PRs). If there are none, feel free to start working on it. If there is an open PR, please collaborate on the work by reviewing it rather than duplicating it in a competing PR.
If something is unclear, please reach out on any of our communication channels.
color=tuple(X[i] / 255) plot_image_segmentation_spectral_graph_partii…
Image (3D RGB data) segmentation by spectral clustering with 3D illus…
Image (3D RGB data) segmentation by spectral clustering with 3D illus…
Image (3D RGB data) segmentation by spectral clustering with 3D illus…