Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Fixed
- Improve `px.*_map()` auto-fitting behavior when `zoom` and `center` are not specified [[#5686](https://github.com/plotly/plotly.py/pull/5686)]


## [7.0.0rc0] - 2026-07-29

Expand Down
8 changes: 4 additions & 4 deletions plotly/express/_chart_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ def scatter_map(
color_continuous_midpoint=None,
opacity=None,
size_max=None,
zoom=8,
zoom=None,
center=None,
map_style=None,
title=None,
Expand Down Expand Up @@ -1296,7 +1296,7 @@ def choropleth_map(
range_color=None,
color_continuous_midpoint=None,
opacity=None,
zoom=8,
zoom=None,
center=None,
map_style=None,
title=None,
Expand Down Expand Up @@ -1331,7 +1331,7 @@ def density_map(
range_color=None,
color_continuous_midpoint=None,
opacity=None,
zoom=8,
zoom=None,
center=None,
map_style=None,
radius=None,
Expand Down Expand Up @@ -1369,7 +1369,7 @@ def line_map(
labels=None,
color_discrete_sequence=None,
color_discrete_map=None,
zoom=8,
zoom=None,
center=None,
map_style=None,
title=None,
Expand Down
8 changes: 1 addition & 7 deletions plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,14 +793,8 @@ def configure_3d_axes(args, fig, orders):


def configure_map(args, fig, orders):
center = args["center"]
if not center and "lat" in args and "lon" in args:
center = dict(
lat=args["data_frame"][args["lat"]].mean(),
lon=args["data_frame"][args["lon"]].mean(),
)
fig.update_maps(
center=center,
center=args["center"],
zoom=args["zoom"],
style=args["map_style"],
)
Expand Down
7 changes: 6 additions & 1 deletion plotly/express/_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,12 @@
"In `'overlay'` mode, strips are on drawn top of one another.",
"In `'group'` mode, strips are placed beside each other.",
],
zoom=["int (default `8`)", "Between 0 and 20.", "Sets map zoom level."],
zoom=[
"int",
"Between 0 and 20.",
"Sets initial map zoom level. Higher values are more zoomed-in.",
"If not provided, the map will select its own zoom level.",
],
orientation=[
"str, one of `'h'` for horizontal or `'v'` for vertical. ",
"(default `'v'` if `x` and `y` are provided and both continuous or both categorical, ",
Expand Down
1 change: 0 additions & 1 deletion tests/percy/plotly-express.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@
size="car_hours",
color_continuous_scale=px.colors.cyclical.IceFire,
size_max=15,
zoom=10,
)
fig.write_html(os.path.join(dir_name, "scatter_map.html"))

Expand Down
Loading