Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9912784

Browse files
committedAug 7, 2019
map thumbs and ordering
1 parent 454f273 commit 9912784

7 files changed

+27
-29
lines changed
 

‎python/bubble-maps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jupyter:
2828
language: python
2929
layout: user-guide
3030
name: Bubble Maps
31-
order: 3
31+
order: 2
3232
page_type: example_index
3333
permalink: python/bubble-maps/
3434
thumbnail: thumbnail/bubble-map.jpg

‎python/choropleth-maps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jupyter:
1919
language: python
2020
layout: user-guide
2121
name: Choropleth Maps
22-
order: 1
22+
order: 5
2323
page_type: u-guide
2424
permalink: python/choropleth-maps/
2525
thumbnail: thumbnail/choropleth.jpg

‎python/county-choropleth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jupyter:
3030
language: python
3131
layout: user-guide
3232
name: USA County Choropleth Maps
33-
order: 0
34-
page_type: example_index
33+
order: 20
34+
page_type: u-guide
3535
permalink: python/county-choropleth/
3636
thumbnail: thumbnail/county-choropleth-usa-greybkgd.jpg
3737
title: Python USA County Choropleth Maps | Plotly

‎python/mapbox-county-choropleth.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.7
23+
version: 3.6.8
2424
plotly:
25-
description: How to make a Mapbox Choropleth Map of US Counties in Python
26-
with Plotly.
25+
description: How to make a Mapbox Choropleth Map of US Counties in Python with
26+
Plotly.
2727
display_as: maps
2828
has_thumbnail: true
2929
ipynb: ~notebook_demo/56
3030
language: python
3131
layout: user-guide
3232
name: Mapbox Choropleth Maps
33-
order: 1.5
34-
page_type: u-guide
33+
order: 1
34+
page_type: example_index
3535
permalink: python/mapbox-county-choropleth/
36-
thumbnail: thumbnail/county-level-choropleth.jpg
36+
thumbnail: thumbnail/mapbox-choropleth.png
3737
title: Python Mapbox Choropleth Maps | plotly
3838
---
3939

@@ -43,12 +43,9 @@ jupyter:
4343
To plot on Mapbox maps with Plotly you *may* need a Mapbox account and a public [Mapbox Access Token](https://www.mapbox.com/studio). See our [Mapbox Map Layers](/python/mapbox-layers/) documentation for more information.
4444

4545

46-
#### Mapbox Light base map: free token needed
46+
#### Carto base map: no token needed
4747

4848
```python
49-
token = open(".mapbox_token").read() # you will need your own token
50-
51-
5249
from urllib.request import urlopen
5350
import json
5451
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
@@ -61,17 +58,20 @@ unemp = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fi
6158
import plotly.graph_objects as go
6259

6360
fig = go.Figure(go.Choroplethmapbox(geojson=counties, locations=unemp.fips, z=unemp.unemp,
64-
colorscale="Viridis", zmin=0, zmax=12))
65-
fig.update_layout(mapbox_style="light", mapbox_accesstoken=token,
61+
colorscale="Viridis", zmin=0, zmax=12,
62+
marker_opacity=0.5, marker_line_width=0))
63+
fig.update_layout(mapbox_style="carto-positron",
6664
mapbox_zoom=3, mapbox_center = {"lat": 37.0902, "lon": -95.7129})
6765
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
6866
fig.show()
6967
```
7068

71-
72-
#### Carto base map: no token needed
69+
#### Mapbox Light base map: free token needed
7370

7471
```python
72+
token = open(".mapbox_token").read() # you will need your own token
73+
74+
7575
from urllib.request import urlopen
7676
import json
7777
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
@@ -84,13 +84,11 @@ unemp = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fi
8484
import plotly.graph_objects as go
8585

8686
fig = go.Figure(go.Choroplethmapbox(geojson=counties, locations=unemp.fips, z=unemp.unemp,
87-
colorscale="Viridis", zmin=0, zmax=12,
88-
marker_opacity=0.5, marker_line_width=0))
89-
fig.update_layout(mapbox_style="carto-positron",
87+
colorscale="Viridis", zmin=0, zmax=12, marker_line_width=0))
88+
fig.update_layout(mapbox_style="light", mapbox_accesstoken=token,
9089
mapbox_zoom=3, mapbox_center = {"lat": 37.0902, "lon": -95.7129})
9190
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
9291
fig.show()
9392
```
94-
9593
#### Reference
9694
See https://plot.ly/python/reference/#choroplethmapbox for more information about mapbox and their attribute options.

‎python/mapbox-density-heatmaps.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jupyter:
3030
language: python
3131
layout: user-guide
3232
name: Mapbox Density Heatmap
33-
order: 1.5
34-
page_type: u-guide
33+
order: 3
34+
page_type: example_index
3535
permalink: python/mapbox-density-heatmaps/
36-
thumbnail: thumbnail/county-level-choropleth.jpg
36+
thumbnail: thumbnail/mapbox-density.png
3737
title: Python Density Heatmap | plotly
3838
---
3939

‎python/mapbox-layers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jupyter:
3131
layout: user-guide
3232
name: Mapbox Map Layers
3333
order: 7
34-
page_type: example_index
34+
page_type: u-guide
3535
permalink: python/mapbox-layers/
36-
thumbnail: thumbnail/scatter-mapbox.jpg
36+
thumbnail: thumbnail/mapbox-layers.png
3737
title: Mapbox Map Layers in Python | Plotly
3838
---
3939

‎python/scattermapbox.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jupyter:
3030
layout: user-guide
3131
mapbox_access_token: pk.eyJ1IjoicHJpeWF0aGFyc2FuIiwiYSI6ImNqbGRyMGQ5YTBhcmkzcXF6YWZldnVvZXoifQ.sN7gyyHTIq1BSfHQRBZdHA
3232
name: Scatter Plots on Mapbox
33-
order: 7
34-
page_type: example_index
33+
order: 8
34+
page_type: u-guide
3535
permalink: python/scattermapbox/
3636
thumbnail: thumbnail/scatter-mapbox.jpg
3737
title: Python Scatter Plots with Mapbox | Plotly

0 commit comments

Comments
 (0)
Please sign in to comment.