该错误是由于在字体属性中使用了"weight"而不是"bold"导致的。正确的写法应该是:

fig.update_layout(title={'text': main_title, 'font': {'size': 20, 'color': 'red', 'weight': 'bold'}}, showlegend=False)

使用"bold"代替"weight"即可。

figupdate_layouttitle=text main_title font size 20 color red weight bold showlegend=False报错应该是 weight bold引起的错误

原文地址: https://www.cveoy.top/t/topic/bpcK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录