我试图在y = 20处向下面的图中添加水平线,但没有成功。
感谢您的帮助!
import plotly.express as px
tips = px.data.tips()
fig = px.box(tips, x="time", y="total_bill")
fig.show()
答案 0 :(得分:2)
您可以像这样添加带有一行的自定义标记:
go.Scatter(y=[20], x=["Dinner"], mode="markers", marker_symbol=41, marker_line_color="red", marker_color="lightskyblue",
marker_line_width=3, marker_size=30, name="max")
答案 1 :(得分:1)