Plotly.express图形返回无

2024-05-29 05:53:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用它的数据框来计算每天的股票收益率。但是,fig命令的out put仅显示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()

Tags: importirisdfdataasfigplotlywidth

热门问题