Open
Description
I am building a line-chart, which uses a colorgradient. The values of the line chart can be negative and positive. I want to add a colorbar to explain the meaning of the colors in the gradient. For this I use labelalias
. The labels only appear for ticks >= 0.
Example
trace = go.Scatter(
x = x,
y = y,
marker = dict(
color=y,
colorscale=[(0.0, "royalblue"), (0.5, "rgba(230, 230,230,0.5)"), (1.0, "orange") ]
colorbar=dict(
title="Score",
tickmode="array",
tickvals=[-10, 0, 10],
labelalias={-10: "Negative", "0": "Neutral", 10: "Positive"},
ticks="",
)
)
)
Expected behavior
The label -10
is replaced by Negative
Context
python==3.11
plotly==5.24.1
Metadata
Metadata
Assignees
Labels
No labels