我正在使用plotly.graph_objects来绘制时间序列,但是生成“颜色”属性的标签使用了所有空间。我想知道 update_layout() 中是否有一个属性可以禁用这些标签
代码:
fig = px.line(
df_complete,
x="Month",
y="Count",
color="Code Description",
text="Count",
hover_data=[
"Month",
"Code Description",
"Count",
],
line_shape="linear",
)
fig.update_layout(
title="Count of activities per month",
xaxis=dict(title="Month"),
yaxis=dict(title="Count"),
)
fig.show()
fig.update_layout(showlegend=False)