Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 707
clex Avatar asked Jan 25 '19 05:01

clex


2 Answers

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})
like image 116
Mohammad Hajiebrahim Avatar answered Sep 23 '22 03:09

Mohammad Hajiebrahim


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});
like image 20
Godwin Avatar answered Sep 19 '22 03:09

Godwin