Blank output instead of plots in offline plotly


#1

I am using offline plotly inside jupyter notebook. I was getting the plots but suddenly I ran my code today and see blank output for similar codes as :

import plotly.offline as pltly
import plotly.graph_objs as go
import numpy as np

N = 500
random_x = np.linspace(0, 1, N)
random_y = np.random.randn(N)

Create a trace

trace = go.Scatter(
x = random_x,
y = random_y
)

data = [trace]

pltly.iplot(data, filename=‘basic-line’)

and Error : " Aw, snap! We didn’t get a username with your request.

Don’t have an account? https://plot.ly/api_signup

Questions? accounts@plot.l" for codes like:

import cufflinks as cf
#Linechart
cf.datagen.lines().iplot(kind=‘scatter’,xTitle=‘Dates’,yTitle=‘Returns’,title=‘Cufflinks - Line Chart’)

or codes like:

import plotly.offline as pltly
import cufflinks as cf
import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.rand(10, 4), columns=[‘a’, ‘b’, ‘c’, ‘d’])
df.iplot(kind=‘area’, fill=True, filename=‘cufflinks/stacked-area’)


#2

Hi @priyankalaha,

It looks like your Chart Studio account info isn’t being found properly. Perhaps try going trough the “Initialization for Online Plotting” instructions again. Or, for plotting inline in the notebook you could switch to “offline” mode (See https://plot.ly/python/getting-started/#initialization-for-offline-plotting) which doesn’t require an account at all.

Hope that helps,
-Jon


#3

Hi @jmmease,
I tried creating the plots as given in the link, I am getting the plots. But if I am working with panda dataframes or cufflinks, I get the Error:
Aw, snap! We didn’t get a username with your request.
Don’t have an account? https://plot.ly/api_signup
Questions? accounts@plot.ly

I have used the following code to test given in https://plot.ly/ipython-notebooks/cufflinks/

import plotly
import plotly.graph_objs as go
import cufflinks as cf
import pandas as pd
import numpy as np
df = cf.datagen.lines()
df.iplot(kind=‘scatter’, filename=‘cufflinks/cf-simple-line’)

Plotly version=3.7.0
Jupyter notebook=5.7.6


#4

I typed the code wrong while replying

import plotly
plotly.offline.init_notebook_mode(connected=True)
import cufflinks as cf
import pandas as pd
import numpy as np
df = cf.datagen.lines()
df.iplot(kind=‘scatter’, filename=‘cufflinks/cf-simple-line’)

I continue to get the same error


#5

Hi @priyankalaha,

If the plots are working with plotly.py directly and not with cufflinks then you could try opening an issue with the cufflinks project and see if anyone over there has any ideas.

-Jon


#6

Hi @jmmease,
Okay, I will do that.

-Priyanka