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: doc/python/scattermapbox.md
+90-56Lines changed: 90 additions & 56 deletions
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.3'
9
-
jupytext_version: 1.16.2
9
+
jupytext_version: 1.16.3
10
10
kernelspec:
11
11
display_name: Python 3 (ipykernel)
12
12
language: python
@@ -22,48 +22,43 @@ jupyter:
22
22
pygments_lexer: ipython3
23
23
version: 3.10.0
24
24
plotly:
25
-
description: How to make scatter plots on Mapbox maps in Python.
25
+
description: How to make scatter plots on tile maps in Python.
26
26
display_as: maps
27
27
language: python
28
28
layout: base
29
29
name: Scatter Plots on Mapbox
30
30
order: 9
31
31
page_type: u-guide
32
-
permalink: python/scattermapbox/
32
+
permalink: python/tile-scatter-maps/
33
33
thumbnail: thumbnail/scatter-mapbox.jpg
34
+
redirect_from: python/scattermapbox/
34
35
---
35
36
36
-
#### Mapbox Access Token and Base Map Configuration
37
-
38
-
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.
39
-
40
37
### Basic example with Plotly Express
41
38
42
-
Here we show the [Plotly Express](/python/plotly-express/) function `px.scatter_mapbox` for a scatter plot on a tile map.
39
+
Here we show the [Plotly Express](/python/plotly-express/) function `px.scatter_map` for a scatter plot on a tile map.
43
40
44
41
[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).
You can define a symbol on your map by setting [symbol](https://plotly.com/python/reference/scattermapbox/#scattermapbox-marker-symbol) attribute. This attribute only works on Mapbox-provided `style`s:
204
+
You can define a symbol on your map by setting [symbol](https://plotly.com/python/reference/scattermap/#scattermap-marker-symbol) attribute.
219
205
220
206
- basic
221
207
- streets
@@ -228,17 +214,14 @@ You can define a symbol on your map by setting [symbol](https://plotly.com/pytho
228
214
```python
229
215
import plotly.graph_objects as go
230
216
231
-
token =open(".mapbox_token").read() # you need your own token
`go.Scattermapbox` supports the following values for `textfont.family`:
273
+
`go.Scattermap` supports the following values for `textfont.family`:
295
274
296
275
'Metropolis Black Italic', 'Metropolis Black', 'Metropolis Bold Italic', 'Metropolis Bold', 'Metropolis Extra Bold Italic', 'Metropolis Extra Bold', 'Metropolis Extra Light Italic', 'Metropolis Extra Light', 'Metropolis Light Italic', 'Metropolis Light', 'Metropolis Medium Italic', 'Metropolis Medium', 'Metropolis Regular Italic', 'Metropolis Regular', 'Metropolis Semi Bold Italic', 'Metropolis Semi Bold', 'Metropolis Thin Italic', 'Metropolis Thin', 'Open Sans Bold Italic', 'Open Sans Bold', 'Open Sans Extrabold Italic', 'Open Sans Extrabold', 'Open Sans Italic', 'Open Sans Light Italic', 'Open Sans Light', 'Open Sans Regular', 'Open Sans Semibold Italic', 'Open Sans Semibold', 'Klokantech Noto Sans Bold', 'Klokantech Noto Sans CJK Bold', 'Klokantech Noto Sans CJK Regular', 'Klokantech Noto Sans Italic', and 'Klokantech Noto Sans Regular'.
297
276
@@ -300,14 +279,12 @@ fig.show()
300
279
301
280
*New in 5.23*
302
281
303
-
You can specify a numeric font weight on `go.Scattermapbox` with `textfont.weight`.
282
+
You can specify a numeric font weight on `go.Scattermap` with `textfont.weight`.
304
283
305
284
```python
306
285
import plotly.graph_objects as go
307
286
308
-
token =open(".mapbox_token").read() # you need your own token
The earlier examples using `px.scatter_map` and `go.Scattermap` use Maplibre for rendering. These traces were introduced in Plotly.py 5.24. These trace types are now the recommended way to create scatter plots on tile-based maps. There are also traces that use Mapbox: `px.scatter_mapbox` and `go.Scattermapbox`
306
+
307
+
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.
308
+
309
+
Here's the first example rewritten to use `px.scatter_mapbox`.
See [function reference for `px.(scatter_mapbox)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_mapbox) or https://plotly.com/python/reference/scattermapbox/ for more information and options!
357
+
See [function reference for `px.(scatter_map)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_mapbox) or https://plotly.com/python/reference/scattermap/ for more information about the attributes available.
358
+
359
+
For Mapbox-based tile maps, see [function reference for `px.(scatter_mapbox)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_mapbox) or https://plotly.com/python/reference/scattermapbox/.
0 commit comments