I have a relatively simple issue, but cannot find any answer online that addresses it. Starting from a simple boxplot:
import plotly.express as px
df = px.data.iris()
fig = px.box(
df, x='species', y='sepal_length'
)
val_counts = df['species'].value_counts()
I would now like to add val_counts
(in this dataset, 50 for each species) to the plots, preferably on either of the following places:
- On top of the median line
- On top of the max/min line
- Inside the hoverbox
How can I achieve this?