简体   繁体   中英

How to remove plotly logo ("Produced with plotly") from plots

By default a plotly plot has their logo with text like "Produced with plotly" (top right). I have a premium account and would like to remove that logo.

Here is a little code snippet that does the final plot:

plotly.tools.set_credentials_file(username='username', api_key='xxxxxxx')
list_df = pd.read_csv('my_csv_file.csv')

names_df = list_df['Name']

trace = go.Scatter(
    x = list_df['Abc'],
    y = list_df['Xyz'],
    visible=True,
    text=names_df,
    hoverinfo = 'text',
    hoverlabel=dict(bgcolor='white'),
    name='ABC',
    line = dict(color='#17BECF'),
    mode = "markers",
    marker=dict(size=8),
    showlegend=False,
    opacity = 0.8
)

data = [trace]

layout = go.Layout(
    title='Lyout Name',
    hovermode = 'closest',

    xaxis=dict(
        title='Title X axis',
        titlefont=dict(
            family='Courier New, monospace',
            size=18,
            color='#7f7f7f'
        )
    ),
    yaxis=dict(
        title='Title Y axis',
        titlefont=dict(
            family='Courier New, monospace',
            size=18,
            color='#7f7f7f'
        )
    )
)

config = {
    'scrollZoom': False,
    'displayModeBar': True,
    'editable': True,
    'showLink':False,
    'displaylogo': False
}

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

py.plot(fig, filename='Filename', auto_open=False, config=config, sharing='secret')

With "'displaylogo': False" in config I expected the logo being removed. But it doesn't.

This is what I got from the official page

Hide the Plotly Logo on the Modebar

 var trace1 = { x:['trees', 'flowers', 'hedges'], y: [90, 130, 40], type: 'bar' }; var data = [trace1]; var layout = { title: 'Hide the Plotly Logo on the Modebar', showlegend: false }; Plotly.newPlot('myDiv', data, layout, {displaylogo: false});

Your mentioned config should be put in fig.show() method or in dcc.graph(), same as follow:

fig.show(id='the_graph', config= {'displaylogo': False})

or

dcc.Graph(id='the_graph', config= {'displaylogo': False})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM