【发布时间】:2021-12-11 03:37:23
【问题描述】:
有人能告诉我为什么这部分 go.Choropleth 代码不起作用吗?
我正在尝试使我的国家的边界更粗更黑,但它不起作用,我不知道在这个布局规范中我还可能缺少什么...这是我的地图代码部分及以下您可以检查生成的地图的缩放部分。请注意该国的边界仍然是细而灰色的,为什么它没有改变?
map_fig_layout = {'coloraxis_colorbar': {'title': 'População (%)',
'thickness': 20,
'ticklabelposition':'outside bottom'},
'margin': {'r':0, 'l':0, 't':0, 'b':0},
'template': 'plotly_dark',
'geo':{'projection': go.layout.geo.Projection(type ='natural earth'),
'landcolor': '#262626',
'showcountries':True,
'showsubunits':True,
'subunitcolor': 'black',
'subunitwidth': 4,
'resolution':110,
'visible':True,
'countrywidth': 4,
'countrycolor' : 'black'},
'uirevision':'not_tracked_key'}
map_graph = go.Figure({'data':[ go.Choropleth(locations = dff['Code'],
z = dff['população_%'], # a column of dff
hovertext = dff['Entity'],
zmin = 0,
zmax = 100,
colorscale = make_colorscale( ['#F53347','#E6C730','#2FF5A8'] ),
geo = 'geo') ],
'layout': map_fig_layout})
【问题讨论】:
标签: python plotly plotly-dash styling choropleth