14

I get an 'PlotlyRequestError: No message' when I execute the code.

import plotly
import plotly.plotly as py
import plotly.graph_objs as go

Filedata = pd.read_csv('C:\\Documents\\Book4.csv')
data = [go.Scatter(x=Filedata.ix[:,0],y=Filedata.ix[:,1])]
layout = go.Layout(
title='Analysis 2016',
xaxis=dict(title='Startdate'),
yaxis=dict(title='Conductivity'))

fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
Chanda Korat
  • 2,453
  • 2
  • 19
  • 23
Kathy
  • 141
  • 1
  • 1
  • 5

4 Answers4

15

This is because you are trying to plot online which requires credentials based authentication. To plot offline, use plotly.offline's plot class to accomplish this without authentication.

from  plotly.offline import plot

and then use this plot to plot your figure.

Ashutosh Gupta
  • 670
  • 7
  • 15
12

I had the same issue and I solved the problem by importing plotly like this:

import plotly.plotly as py
import plotly.graph_objs as go
# these two lines allow your code to show up in a notebook
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode()

And then calling iplot like this:

plotly.offline.iplot(...)
Dharman
  • 30,962
  • 25
  • 85
  • 135
1

I had the same issue and I solved the problem by importing plotly and cufflinks like this:

from plotly.offline import iplot
import cufflinks as cf

and then apply

cf.go_offline()
Hemang Dhanani
  • 175
  • 1
  • 4
0

!pip install plotly !pip install cufflinks import cufflinks as cf cf.go_offline()

df.iplot()

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 02 '23 at 23:28
  • Can you elaborate a bit? – TheTridentGuy supports Ukraine Jun 05 '23 at 04:58