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
Copy file name to clipboardExpand all lines: python/filled-area-on-mapbox.md
+15-12
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ jupyter:
6
6
extension: .md
7
7
format_name: markdown
8
8
format_version: '1.1'
9
-
jupytext_version: 1.2.1
9
+
jupytext_version: 1.1.1
10
10
kernelspec:
11
11
display_name: Python 3
12
12
language: python
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.3
23
+
version: 3.6.8
24
24
plotly:
25
25
description: How to make an area on Map in Python with Plotly.
26
26
display_as: maps
@@ -36,18 +36,20 @@ jupyter:
36
36
title: Python Mapbox Choropleth Maps | plotly
37
37
---
38
38
39
+
<!-- #region -->
39
40
40
41
### Mapbox Access Token
41
42
42
43
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.
43
44
44
45
45
-
### How to Show an Area on a Map
46
+
There are three different ways to show a filled area in a Mapbox map:
47
+
1. Use a [Scattermapbox](https://plot.ly/python/reference/#scattermapbox) trace and set `fill` attribute to 'toself'
48
+
2. Use a Mapbox layout (i.e. by minimally using an empty [Scattermapbox](https://plot.ly/python/reference/#scattermapbox) trace) and add a GeoJSON layer
49
+
3. Use the [Choroplethmapbox](https://plot.ly/python/mapbox-county-choropleth/) trace type
50
+
<!-- #endregion -->
46
51
47
-
There are three different ways to show an area in a mapbox:
48
-
- Use [Scattermapbox](https://plot.ly/python/reference/#scattermapbox) trace and set `fill` attribute to 'toself'
49
-
- Use [Scattermapbox](https://plot.ly/python/reference/#scattermapbox) trace and define the corresponding geojson
50
-
- Use the new trace type: [Choroplethmapbox](https://plot.ly/python/mapbox-county-choropleth/) for mapbox cases, or [Choropleth](https://plot.ly/python/choropleth-maps/) trace for non-mapbox ones.
52
+
### Filled `Scattermapbox` Trace
51
53
52
54
The following example uses `Scattermapbox` and sets `fill = 'toself'`
53
55
@@ -69,16 +71,17 @@ fig.update_layout(
69
71
fig.show()
70
72
```
71
73
72
-
### Provide Gaps on Map
74
+
### Multiple Filled Areas with a `Scattermapbox` trace
73
75
74
-
The following example shows how to use missing values in your data to provide gap in your graph. To ignore the gap on your plot, take benefit of [connectorgaps](https://plot.ly/python/reference/#scattermapbox-connectgaps) attribute.
76
+
The following example shows how to use `None`in your data to draw multiple filled areas. Such gaps in trace data are unconnected by default, but this can be controlled via the [connectgaps](https://plot.ly/python/reference/#scattermapbox-connectgaps) attribute.
Copy file name to clipboardExpand all lines: python/lines-on-mapbox.md
+12-48
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ jupyter:
6
6
extension: .md
7
7
format_name: markdown
8
8
format_version: '1.1'
9
-
jupytext_version: 1.2.1
9
+
jupytext_version: 1.1.1
10
10
kernelspec:
11
11
display_name: Python 3
12
12
language: python
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.3
23
+
version: 3.6.8
24
24
plotly:
25
25
description: How to draw a line on Map in Python with Plotly.
26
26
display_as: maps
@@ -40,39 +40,30 @@ jupyter:
40
40
41
41
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.
42
42
43
-
### How to draw a Line on a Map
43
+
To draw a line on your map, you either can use [`px.line_mapbox()`](https://www.plotly.express/plotly_express/#plotly_express.line_mapbox) in plotly express, or [`Scattermapbox`](https://plot.ly/python/reference/#scattermapbox) traces. Below we show you how to draw a line on Mapbox using plotly express.
44
44
45
-
To draw a line on your map, you either can use [line_mapbox](https://www.plotly.express/plotly_express/#plotly_express.line_mapbox) in plotly express, or [Scattermapbox](https://plot.ly/python/reference/#scattermapbox) and [scattergeo](https://plot.ly/python/reference/#scattergeo) trace type in plotly. Below we show you how to draw a line on Mapbox using plotly express.
Copy file name to clipboardExpand all lines: python/scattermapbox.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.6.7
23
+
version: 3.6.8
24
24
plotly:
25
25
description: How to make scatter plots on Mapbox maps in Python.
26
26
display_as: maps
@@ -198,7 +198,7 @@ fig.show()
198
198
199
199
### Set Marker Symbols
200
200
201
-
You can define a symbol on your map by setting [symbol](https://plot.ly/python/reference/#scattermapbox-marker-symbol) attribute. This attribute only works on mapbox tiles (not work on raster tiles):
201
+
You can define a symbol on your map by setting [symbol](https://plot.ly/python/reference/#scattermapbox-marker-symbol) attribute. This attribute only works on Mapbox-provided `style`s:
0 commit comments