You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fitbounds="locations" parameter not working for px.choropleth_map #4262
The fitbounds parameter appear not to work when used in choropleth mapbox. The only way I found to pass it to the Figure object was to use the update_geos method.
The following is a sample of the code to show the parameter used:
Another example is given by https://stackoverflow.com/q/63787612/16797805. Old question, but still "valid", in the sense that the fitbounds parameter for the choropleth mapbox plot still does not work.
This doesn't work because choropleth_map doesn't support fitbounds yet. That still needs to be added in plotly.js, at which point it can bubble up to Plotly Express. Our docs don't seem to mention this anywhere. This is sort of covered in plotly/plotly.js#3434. There's an open PR to add support to plotly.js in plotly/plotly.js#7911.
changed the title [-]`fitbounds="locations"` parameter not working for `px.choropleth_mapbox`[/-][+]`fitbounds="locations"` parameter not working for `px.choropleth_map`[/+]on Sep 2, 2026
Activity
tantardini commentedon Jul 3, 2023
Another example is given by https://stackoverflow.com/q/63787612/16797805. Old question, but still "valid", in the sense that the fitbounds parameter for the choropleth mapbox plot still does not work.
b-a0 commentedon Sep 2, 2026
Also doesn't work on
px.choropleth_map(),fig.update_geos(fitbounds="locations")doesn't work either with that choroplethcamdecoster commentedon Sep 2, 2026
This doesn't work because
choropleth_mapdoesn't supportfitboundsyet. That still needs to be added in plotly.js, at which point it can bubble up to Plotly Express. Our docs don't seem to mention this anywhere. This is sort of covered in plotly/plotly.js#3434. There's an open PR to add support to plotly.js in plotly/plotly.js#7911.[-]`fitbounds="locations"` parameter not working for `px.choropleth_mapbox`[/-][+]`fitbounds="locations"` parameter not working for `px.choropleth_map`[/+]