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
We want to plot colored point clouds. We have the colors as a numpy array of type uint8, but the bug also occurs when we simply pass a list of [r,g,b] values.
However, the odd thing (and that is unexpected) is that it doesn't yield an error when we pass the colors in this way. However, when one of the values (r/g/b) equals 1, we get the wrong color. This does not happen for 0 or 2 (or any other number).
Minimal example:
import plotly.graph_objs as go
go.Figure().add_trace(go.Scatter3d(x=[1,2,3], y=[1,1,1], z=[1,1,1], mode='markers', marker=dict(color=[[255, 0, 0], [1, 255, 0], [0, 0, 255]], size=10)))
produces red/yellow/blue dots (instead of red/green/blue).
In other cases, we observe that we get white (for example for [1,255,1]).
FWIW, the problem does not occur if we scale the values to 0..1:
import plotly.graph_objs as go
go.Figure().add_trace(go.Scatter3d(x=[1,2,3], y=[1,1,1], z=[1,1,1], mode='markers', marker=dict(color=[[1, 0, 0], [1/255., 1, 0], [0, 0, 1]], size=10)))
renders as expected (red/green/blue).
The text was updated successfully, but these errors were encountered:
We want to plot colored point clouds. We have the colors as a numpy array of type uint8, but the bug also occurs when we simply pass a list of [r,g,b] values.
We are aware that passing colors as a list of [r,g,b] is not supported, so feel free to close this bug as invalid.
https://plotly.github.io/plotly.py-docs/generated/plotly.graph_objects.scatter3d.html#plotly.graph_objects.scatter3d.Marker.color
However, the odd thing (and that is unexpected) is that it doesn't yield an error when we pass the colors in this way. However, when one of the values (r/g/b) equals 1, we get the wrong color. This does not happen for 0 or 2 (or any other number).
Minimal example:
produces red/yellow/blue dots (instead of red/green/blue).
In other cases, we observe that we get white (for example for [1,255,1]).
FWIW, the problem does not occur if we scale the values to 0..1:
renders as expected (red/green/blue).
The text was updated successfully, but these errors were encountered: