简体   繁体   中英

Plotly.express graph returns None

I want to calculating a stock return daily by it's data frame. However, the out put of the fig command just show 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())

Edited : My problem above has been solved. However, what about the following? Nothing appears.

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()

You want to do fig.show() at the end, not print(fig.show())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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