Skip to content

Commit a2ecc5c

Browse files
authored
Merge pull request #5478 from plotly/update-example
Update example to use geodatasets
2 parents 4be2983 + 279b716 commit a2ecc5c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

doc/python/scatter-plots-on-maps.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.4.2
8+
format_version: '1.3'
9+
jupytext_version: 1.16.4
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.7
23+
version: 3.10.0
2424
plotly:
2525
description: How to make scatter plots on maps in Python. Scatter plots on maps
2626
highlight geographic areas and can be colored by value.
@@ -73,10 +73,10 @@ fig.show()
7373
```python
7474
import plotly.express as px
7575
import geopandas as gpd
76+
from geodatasets import get_url
7677

77-
geo_df = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))
78+
geo_df = gpd.read_file(get_url("naturalearth.cities"))
7879

79-
px.set_mapbox_access_token(open(".mapbox_token").read())
8080
fig = px.scatter_geo(geo_df,
8181
lat=geo_df.geometry.y,
8282
lon=geo_df.geometry.x,

doc/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cufflinks==0.17.3
44
dash-bio
55
dask==2022.2.0
66
datashader==0.14.4
7+
geodatasets==2026.1.0
78
geopandas==0.8.1
89
geoparse<=2.0.3
910
igraph

0 commit comments

Comments
 (0)