✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

How to re-size Choropleth maps

I’m trying to modify the size of the following example. But It keeps always in the same square size.

df = px.data.election()
geojson = px.data.election_geojson()

fig = px.choropleth(df, geojson=geojson, color=“winner”,
locations=“district”, featureidkey=“properties.district”,
projection=“mercator”, hover_data=[“Bergeron”, “Coderre”, “Joly”]
fig.update_geos(fitbounds=“locations”, visible=False)

I’m new in plotly, many thanks in advance.

Hi @jesonora
My solution wasn’t perfect but it helped me resize the map a little:

fig.update_layout(margin=dict(l=60, r=60, t=50, b=50))

Hope this helps,

Hi @adamschroeder,

Even with your solution I’m not able to change the size of the map.


I was my mistake about the projection feature.