我正在用 Plotly 制作分区统计图。但是,地理地图看起来很小。
我的代码在这里:
fig = px.choropleth(df,
geojson=geojson,
locations="Capitalize",
featureidkey="properties.name",
color="Scale",
hover_name='Capitalize',
hover_data=['Quantity'],
animation_frame="Period",
projection="mercator",)
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(title_text = 'Product A',
autosize=True,
hovermode='closest',
title_x = 0.5,
margin={"r":0,"t":100,"l":0,"b":0},
geo=dict(showframe = False, showcoastlines = False))
Run Code Online (Sandbox Code Playgroud)
宽度和高度属性并没有完全达到我想要的效果。我只想放大地理地图。我怎样才能在情节中做到这一点?