我在隐藏背景时使用情节
paper_bgcolor='rgba(255,255,255,1)',
plot_bgcolor='rgba(255,255,255,1)',
不幸的是,阅读布局的参考指南,我无法添加轴(只有左侧和底部的 xy 线。
完整代码:
fig = px.box(pd_data, x="Epoch", y="Cosine similarity", color="Type",
notched=True, # used notched shape
title="Box plot of Cos similarity",
hover_data=["Pair"] # add day column to hover data
)
fig.update_layout(title_text="",
paper_bgcolor='rgba(255,255,255,1)',\
plot_bgcolor='rgba(255,255,255,1)',\
title_font_size=30)
Result: