Assume having the data:
import pandas as pd
df = pd.DataFrame(
{
"val": np.random.normal(0, 1, size=100),
"cat": np.random.choice(["a", "b"], size=100),
}
)
Next, visualize a box plot:
from plotly import graph_objects as go
fig = go.Figure()
fig.add_trace(go.Box(y=df["val"], x=df["cat"], boxmean="sd",))
I'm using go.Box since I want to visualize the STD. This yields:
How can I set different colors of for the left and right box plots depending on the category?

