我用python绘出了一个条形图,我想在一个特定的条形图上画一个标记,比如不吸烟的女性.
我从plotly文档中取了一个例子,如果我try 放置标记,它只会占据主类别的中心.
import plotly.express as px
df = px.data.tips()
fig = px.histogram(df, x="sex", y="total_bill",
color='smoker', barmode='group',
height=400)
#trying to set the marker
fig.add_trace(
go.Scatter(x=["Female"],
y=[1100]
))
fig.show()