[英]Plotly: How to define colors in a figure using Plotly Graph Objects and 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.