-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
Description
Error bars do correctly show with the same color (not opacity) as markers when using categorical data to set the color parameter:
import plotly.express as px
df = px.data.iris()
df["e_plus"] = df["sepal_width"]/100
df["e_minus"] = df["sepal_width"]/40
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
error_y="e_plus", error_y_minus="e_minus")
fig.show()

However, setting the opacity parameter only changes the opacity of the markers:
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
error_y="e_plus", error_y_minus="e_minus", opacity=0.6)
fig.show()

And using numerical data to set the color parameter, the error bars will not have the same color as the markers, but instead renders in black:
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="petal_width",
error_y="e_plus", error_y_minus="e_minus")
fig.show()

Fixing this would be super helpful, since the only current solution seems to be to manually add or update the trace for every single data point to set rgba-values for the error bars. My scatter plot had a few thousand data points, making that a very time consuming for-loop.