cle*_*lex 6 python python-3.x plotly
默认情况下,一个情节情节有他们的标志和文字,如“用情节制作”(右上角)。我有一个高级帐户,想删除该徽标。
这是一个完成最终情节的小代码片段:
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')
Run Code Online (Sandbox Code Playgroud)
在配置中使用 "'displaylogo': False" 我希望徽标被删除。但事实并非如此。
小智 24
您提到的配置应该放在Fig.show()方法或dcc.graph()中,如下所示:
fig.show(id='the_graph', config= {'displaylogo': False})
Run Code Online (Sandbox Code Playgroud)
或者
dcc.Graph(id='the_graph', config= {'displaylogo': False})
Run Code Online (Sandbox Code Playgroud)
小智 6
这是我从官方页面得到的
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});Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5208 次 |
| 最近记录: |