繁体   English   中英

Plotly.express 图返回无

[英]Plotly.express graph returns None

我想通过它的数据框每天计算股票收益。 但是, fig 命令的输出只显示None

import plotly.express as px

df = px.data.iris()

fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", marginal_y="violin",
           marginal_x="box", trendline="ols", template="simple_white")

print(fig.show())

编辑:我上面的问题已经解决了。 然而,下面的呢? 什么都没有出现。

import plotly.express as px

df = px.data.iris()

fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", marginal_y="violin", marginal_x="box", trendline="ols", template="simple_white")

fig.show()

你想在最后做fig.show() ,而不是print(fig.show())

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM