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
Color scale doesn't show up for Lines on Scatter3d plots #1085
Just in case anyone else comes across this bug, here's the workaround I'm using:
Example workaround
importnumpyasnpimportplotly.graph_objsasgodefgen_color_bar(line_trace):
""" Generates a trace which shows a colorbar based on a line plot. Relevant issue: https://github.com/plotly/plotly.py/issues/1085 """returngo.Scatter3d(
x=line_trace.x, y=line_trace.y, z=line_trace.z,
mode="markers",
marker=go.scatter3d.Marker(
color=line_trace.line.color,
colorscale=line_trace.line.to_plotly_json()["colorscale"], # Waiting on https://github.com/plotly/plotly.py/issues/1087showscale=line_trace.line.showscale,
opacity=0.00000000000001# Make invisible, visible=False disables color bar
),
hoverinfo="none",
showlegend=False
)
# Example usagex, y, z, c=np.random.random_sample((4, 10))
line_trace=go.Scatter3d(
x=x,y=y,z=z,
mode="lines",
line=go.scatter3d.Line(
color=c,
colorscale="Viridis",
showscale=True
),
showlegend=False
)
colorbar_trace=gen_color_bar(line_trace)
go.FigureWidget(data=[
line_trace,
colorbar_trace
])
Activity
ivirshup commentedon Aug 2, 2018
Just in case anyone else comes across this bug, here's the workaround I'm using:
Example workaround
jonmmease commentedon Jan 8, 2019
Tracking plotly/plotly.js#3384
jonmmease commentedon Jan 26, 2019
Closed by plotly/plotly.js#3384 and released in plotly.js 1.44.0 and will be released in plotly.py 3.6.0