The box plot is offering a lot of information. However, I could not find the option to display the same size in the parameters. So I made a small code snippet which appends this information as annotation. Hopefully this will help out anyone who has similar needs.
for i in df0[groupfilter].unique():
traces.append(go.Box(
x=df0[groupfilter.loc[(df0[groupfilter]==i)],
y=Y.loc[(df0[radioitems[0]]==i)],
name = str(i)
))
annotations.append({"x":traces[0]["x"][0],
"y":Y.loc[(df0[radioitems[0]]==i)].max(),
"showarrow":False,
"yshift": 20,
"text": "sample size",
"ax":0,
"ay":40})
fig = {"data": traces, "layout": go.Layout(
title={'text': "text"}, xaxis={"type": 'category'},
annotations = annotations)}
Somehow drawing the arrowhead slows down process time by a bit so I have set it to False. I have shifted the number slightly upwards. I felt putting the number at the highest point makes more sense, but depending on your preference you could put it left or right etc. Also in my case I had to plot multiple box plots so the trace is indexed which may not be necessary.