How can I remove the success message in jupyter?


#1

I am using plotly in a jupyter notebook. Whenever I render a chart, it first prints a message:

“High five! You successfully sent some data to your account on plotly. View your plot in your browser at [link] or inside your plot.ly account where it is named ‘d3-cloropleth-map’”

Is there a way to remove this message? I really don’t want it in my notebook, as this is for a school project and we want it to look polished.


#2

Hi @caseyah,

I’m not really sure where this message is coming from, but I don’t see it in Jupyter when I run this snipped with plotly.py 3.4

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

trace0 = go.Scatter(
    x=[1, 2, 3, 4],
    y=[10, 15, 13, 17]
)
trace1 = go.Scatter(
    x=[1, 2, 3, 4],
    y=[16, 5, 11, 9]
)
data = [trace0, trace1]

py.iplot(data, filename = 'basic-line')

Do you see it in this case? If not, could you add an example of when you get the message? Also, please include the version of plotly.py you’re using. Thanks!

-Jon


#3

Thanks for your answer, @jmmease!

I don’t see it with your code, but I’m still seeing it with mine:
I’m using plotly 3.4.2.

import pandas as pd
import plotly

plotly.tools.set_credentials_file(username=user, api_key=key)

for col in data_538.columns:
    data_538[col] = data_538[col].astype(str)

scl = [[0.0, 'rgb(242,240,247)'],[0.2, 'rgb(218,218,235)'],[0.4, 'rgb(188,189,220)'],\
            [0.6, 'rgb(158,154,200)'],[0.8, 'rgb(117,107,177)'],[1.0, 'rgb(84,39,143)']]

data_538['text'] = data_538['state'] + '<br>' +\
    'AVerage per 100k people '+data_538['avg_hatecrimes_per_100k_fbi']

data = [ dict(
        type='choropleth',
        colorscale =  scl,
        autocolorscale = False,
        locations = data_538['code'],
        z = data_538['avg_hatecrimes_per_100k_fbi'].astype(float),
        locationmode = 'USA-states',
        text = data_538['text'],
        marker = dict(
            line = dict (
                color = 'rgb(255,255,255)',
                width = 2
            )
        ),
        colorbar = dict(
            title = "Hate Crimes per 100k"
        )
    ) ]

layout = dict(
        title = 'Hate crimes per 100k people',
        geo = dict(
            scope='usa',
            projection=dict( type='albers usa' ),
            showlakes = True,
            lakecolor = 'rgb(255, 255, 255)',
        ),
    )

fig = dict( data=data, layout=layout )

py.iplot( fig, filename='d3-cloropleth-map' )```

#4

Hi @caseyah,

The data_538 data frame isn’t defined in the code above so I’m not able to run it. Could you add a URL to the dataset? When I replace it with another dataframe I don’t see the message.

-Jon


#5

Hi @jmmease, sorry about that!

Here is a link to the data: https://github.com/fivethirtyeight/data/blob/master/hate-crimes/hate_crimes.csv

However, I’m not sure it’s an issue with the data. The only other thing that would be different when you run it is the authentication, do you think I could be getting the message because I’m on the free plan of plotly?

Thanks,
Casey


#6

Hi @caseyah,

I’m still not able to run the example because the dataset doesn’t include a code column. I’m also not sure that it’s related to the data, but it always best to start troubleshooting with the same example :slightly_smiling_face:

Another option is to switch to using offline mode https://plot.ly/python/offline/, which doesn’t upload any data and won’t produce any logging messages.

-Jon