I am trying to remove max and min in a boxplot using Graph Objects (i.e. only show q1, median and q3). Since I have precompiled quartiles, I used the example from the plotly documentation: Box plots in Python . I tried to set the parameter hoverinfo to “q1+median+q3” but that causes an error. In addition, I tried to define a hovertemplate but this seems to be ignored. Any help in how to implement this is highly appreciated.
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Box(y=[
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
], name="Precompiled Quartiles"))
fig.update_traces(q1=[ 1, 2, 3 ], median=[ 4, 5, 6 ],
q3=[ 7, 8, 9 ], lowerfence=[-1, 0, 1],
upperfence=[5, 6, 7], mean=[ 2.2, 2.8, 3.2 ],
sd=[ 0.2, 0.4, 0.6 ], notchspan=[ 0.2, 0.4, 0.6 ] )
fig.show()