Fix bad default zoom in Plotly Express map functions - #5686
Merged
Conversation
…() functions (now handled in plotly.js). Note: choropleth map auto-centering is not yet supported in plotly.js, but the default plotly.js zoom of 1 is still better than an arbitrary zoom of 8.
…test auto-fit behavior
camdecoster
approved these changes
Jul 30, 2026
camdecoster
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Could you update the zoom docstring in plotly/express/_doc.py? It still says the default is 8.
Contributor
Author
Good catch, will do. |
emilykl
force-pushed
the
fix-bad-default-zoom-5450
branch
from
July 30, 2026 16:33
57a7e55 to
79d791a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue
Closes #5450
Description of change
8frompx.scatter_map(),px.line_map(),px.density_map()andpx.choropleth_map()functionschoroplethis not yet supported by plotly.js, but it didn't work in Plotly Express either sincepx.choropleth_map()has nolatorlonargumentszoomargument frompx.scatter_map()Percy test to visually verify auto-fit behaviorDemo
The following screenshots show the plots produced without passing any
centerorzoomsettings to the px function.Code:
Details
Testing strategy
px.scatter_map()Percy test so that any changes in scattermap fitting behavior will be capturedpx.line_map()andpx.density_map()already don't pass explicitcenterorzoomTo test locally: Run the code snippet above
Guidelines