I have the following cell in a jupyter notebook (inspired by https://plotly.com/python/box-plots/#fully-styled-box-plots):
import plotly.graph_objects as go
N = 50
y = [(10 * np.random.randn(N) + i) for i in range(16)]
fig3 = go.Figure()
# add traces
for i in range(16):
trace = go.Box(y=y[i],
boxpoints="all",
notched=True,
jitter=0.8,
whiskerwidth=1,
fillcolor=rainbow_colors[i],
marker_size=2,
pointpos=-2,
line_width=1,
marker_color = rainbow_colors[i],
line_color="black",
)
fig3.add_trace(trace)
fig3.update_layout(
title='Some Values',
yaxis=dict(
autorange=True,
showgrid=True,
zeroline=True,
dtick=10,
gridcolor='rgb(255, 255, 255)',
gridwidth=1,
zerolinecolor='rgb(255, 255, 255)',
zerolinewidth=2,
),
margin=dict(
l=40,
r=30,
b=80,
t=100,
),
paper_bgcolor='rgb(243, 243, 243)',
plot_bgcolor='rgb(243, 243, 243)',
showlegend=True
)
fig3.show()
Now I want to set the quantiles manually as in https://plotly.com/python/box-plots/#box-plot-with-precomputed-quartiles
No matter what I try though, it does not work.
When I add
q1=[i-10],
q3=[i+10],
median=[0],
orientation="v"
to the Box-parameters, each box has the quantiles set correctly. However the boxes are then all stacked on top of each other and datapoints are not drawn either:
I want to retain the former representation of data but with custom quantiles. Is that possible?
Thank you