【发布时间】:2021-10-31 16:19:00
【问题描述】:
我有一个情节表达图:
fig = px.line(data, x="DateTime", y="Gold", title="Gold Prices")
我想改变一些细节,像这样
fig.update_layout(
line_color="#0000ff", # ValueError: Invalid property specified for object of type plotly.graph_objs.Layout: 'line'
line=dict(
color='rgb(204, 204, 204)',
width=5
), # Bad property path: line
)
但是两次尝试(尝试我在这里研究过的解决方案)都失败了,并在 cmets 中给出了错误。
我也试过fig = px.line(data, x="DateTime", y="Gold", title="Gold Prices", template="ggplot2", color_discrete_map={"Gold": "green"}),但无济于事。
请问我该如何完成这项工作?
【问题讨论】:
标签: python plotly-dash linegraph plotly-express