✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Plotly 2.0 wont save any plots

I’m trying to upload an excel sheet into plotly to make a plot of some data.
Every time I try to save my plot, and related grid, in Chrome I get the following error messages;

"Uh oh… failure creating grid!“
and
"The content-length resource is limited to 524288/request. Used 532867.”

The number at the end of the error occasionally changes any time I try to save. sometimes it ends with “Used 923490” instead. This happens any time I try to save in Chrome. In Internet explorer It won’t even let me upload my excel data. I receive this error when I try that;

“Hm… we had trouble uploading or parsing this example for some reason. Note that we only support CSV and Excel files right now.”

And when I copy and paste my data into the internet explorer data sheet it won’t let me save, giving me the same errors that I get in chrome. I’ve used plotly for a few weeks with no issue until this started happening, any help is appreciated.

EDIT; It seems that uploading my data in 1.0 and then saving has resolved the issue for now. But if anyone knows a better solution in case this problem arises again it’s be greatly appreciated.

Hey there! That’s unfortunate; I’m sorry that you’re experiencing this problem.

I’d like to help you by replicating this issue. Would you mind attaching your data file here, if it’s not a problem for you?

I there !
I experience the same error. unfortunately I can’t join a html file, but it is a simple plot, onlt with 29000 lines.
The result is that I can’t save my plot, because when I try to open with plotly1, the data are not saved.
Help please !
thanks in advance,
2t

Hi, jwbrooks.

Would you mind sharing your data file with me so I can replicate the problem if you’re still having this issue?

Thank you.

Are you attempting to save your plot as ‘private’ or ‘public’?

Can you also share your csv or excel data file with me?

Thank you for your concern.
My plot is here :


I just can’t save it… :frowning:

That’s an html file. The workspace only allows csv and excel files.

Yes I know !

The way I work is to generate the html (from Python), then click on the
“Save and edit plot in cloud” icon upper-right. Then clicking “save”
raise an error. and I can’t save…

Hi there,

Just to continue helping, may I ask how you are generating the html? Are you using offline mode and independently, are you using py.iplot to create your chart? Also, are you working in the ipython notebook?

Hy Adam, thanks for helping.

The html is generated from python 3.5 anaconda spyder 3, with plotly.offline.plot
The function is :


import plotly.offline as pyoff
import plotly.graph_objs as go
import pandas as pd
def plot(df_,df_2=[],colors = '',name = "tmp",echelles = []):
    if ~isinstance(df_,pd.DataFrame) : df_ = pd.DataFrame(
        cols1 = df_.columns
    if ~isinstance(df_2,pd.DataFrame) : df_2 = pd.DataFrame(df_2)
    cols2 = df_2.columns
    nb1 = len(cols1)
    nb2 = len(cols2)
    nb = nb1+nb2
    
    if len(echelles)>0:
        if not isinstance(echelles[0],list):
            range1 = range2 = echelles
        else:
            range1 = echelles[0]
            if len(echelles)>1:
                range2 = echelles[1]
            else:
                range2 = range1
    else : 
        range1 = range2 = []    

    data = [
        go.Scatter( \
            x = df_[cols1[col]].index, # assign x as the dataframe column 'x'
            y = df_[cols1[col]].values,
            name = str(cols1[col]),
            line = dict(
                color = 'hsl('+str(((col) / nb * 360)%360)+',50%'+',50%)',#('rgb(205, 12, 24)'),
                width = 2,
                ),
            mode = 'line',
            fill='tozeroy' if 'penalise' in cols1[col] else None 
        )
    for col in range(0,len(cols1))]

    [data.append (
        go.Scatter( 
            x = df_2[cols2[col]].index, # assign x as the dataframe column 'x'
            y = df_2[cols2[col]].values,
            name = str(cols2[col]),
            line = dict(
                color = 'hsl('+str(((col+nb1) / nb * 360)%360)+',50%'+',50%)',#('rgb(205, 12, 24)'),
                width = 2,
                ),
            mode = 'line',
            yaxis='y2',
        )   )for col in range(0,len(cols2))]
                        
    layout = go.Layout(
        xaxis=dict(
            autotick=True,
        ),
        yaxis=dict(
            autotick=True,
            title = 'y1',
            autorange = True if range1 == [] else False,
            range = range1,
        ),
        yaxis2= dict(
            side= 'right',
            title="y2",
            autorange = True if range2 == [] else False,
            range = range2,
            overlaying= 'y',
        )
    )
    print('Traçage des données')
    fig = go.Figure(data=data, layout=layout)
    pyoff.plot(fig, filename='../outputs/figures/' + name +'.html')

Nothing very special I guess

So we actually just opened an issue because of your error message, located here and it looks like since you are a free user, you are getting throttled for hitting the content-limit.

Ok, thanks.

I guess this means I have to pay at one point…

I had the same issue. I think it was because the plotly server didn’t like some of the plot data for my plot. Specifically, I was sending very precise color data for my data points (e.g., each color channel was represented by a number like 185.2342342234325234234). After rounding my data to integers, the problem went away and I was able to save.

Not sure if this directly relates to your issue, but I would recommend reviewing your plot data and simplifying it (e.g., rounding it) where you can.