I'm trying to use plotly to plot a simple graph
My code is shown as follow
import plotly.express as px
x = [1,2,3]
y = [1,2,3]
fig = px.line(x=x, y=y,labels={'x':x_name,'y':y_name})
fig.show()
when I run this code, sometimes the browser is showing This site can’t be reached
I've searched on this question 1 2 3 , but did not got any answer.
How should I solve this problem when the browser shows This site can’t be reached ?
instead of the fig.show() try using plotly.offline.plot(fig) to plot in offline mode
more details can be found here: https://pythonbasics.org/plotly/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With