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/axes.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Other kinds of subplots and axes are described in other tutorials:
41
41
-[Polar axes](/python/polar-chart/). The axis object is [`go.layout.Polar`](/python/reference/layout/polar/)
42
42
-[Ternary axes](/python/ternary-plots). The axis object is [`go.layout.Ternary`](/python/reference/layout/ternary/)
43
43
-[Geo axes](/python/map-configuration/). The axis object is [`go.layout.Geo`](/python/reference/layout/geo/)
44
-
-[Mapbox axes](/python/mapbox-layers/). The axis object is [`go.layout.Mapbox`](/python/reference/layout/mapbox/)
44
+
-[Map axes](/python/map-layers/). The axis object is [`go.layout.Map`](/python/reference/layout/map/)
45
45
-[Color axes](/python/colorscales/). The axis object is [`go.layout.Coloraxis`](/python/reference/layout/coloraxis/).
46
46
47
47
**See also** the tutorials on [facet plots](/python/facet-plots/), [subplots](/python/subplots) and [multiple axes](/python/multiple-axes/).
@@ -453,10 +453,10 @@ fig.show()
453
453
*New in 5.23*
454
454
455
455
You can adjust tick label positions by moving them a number of pixels away from the axis using `ticklabelstandoff` or along the axis using `ticklabelshift`.
456
-
456
+
457
457
In this example, `ticklabelshift=25` shifts the labels 25 pixels to the right along the x-axis. By providing a negative value, we could move the labels 25 pixels to the left, (`ticklabelshift=-25`).
458
458
459
-
Here, `ticklabelstandoff=15` moves the labels further 15 pixels away from the x-axis. A negative value here would move them close to the axis.
459
+
Here, `ticklabelstandoff=15` moves the labels further 15 pixels away from the x-axis. A negative value here would move them close to the axis.
460
460
461
461
```python
462
462
import plotly.express as px
@@ -483,7 +483,7 @@ fig.show()
483
483
484
484
On date or linear axes, use `ticklabelindex` to draw a label for a minor tick instead of a major tick.
485
485
486
-
To draw the label for the minor tick before each major tick, set `ticklabelindex` -1, like in the following example.
486
+
To draw the label for the minor tick before each major tick, set `ticklabelindex` -1, like in the following example.
Copy file name to clipboardExpand all lines: doc/python/choropleth-maps.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ jupyter:
33
33
thumbnail: thumbnail/choropleth.jpg
34
34
---
35
35
36
-
A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/mapbox-county-choropleth).
36
+
A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).
37
37
38
38
Below we show how to create Choropleth Maps using either Plotly Express' `px.choropleth` function or the lower-level `go.Choropleth` graph object.
Copy file name to clipboardExpand all lines: doc/python/county-choropleth.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ jupyter:
5
5
text_representation:
6
6
extension: .md
7
7
format_name: markdown
8
-
format_version: '1.2'
9
-
jupytext_version: 1.3.1
8
+
format_version: '1.3'
9
+
jupytext_version: 1.16.3
10
10
kernelspec:
11
-
display_name: Python 3
11
+
display_name: Python 3 (ipykernel)
12
12
language: python
13
13
name: python3
14
14
language_info:
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.6.8
23
+
version: 3.10.0
24
24
plotly:
25
25
description: How to create colormaped representations of USA counties by FIPS
26
26
values in Python.
@@ -37,7 +37,7 @@ jupyter:
37
37
### Deprecation warning
38
38
39
39
40
-
This page describes a [legacy "figure factory" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [Mapbox tile-based choropleth maps](/python/mapbox-county-choropleth).
40
+
This page describes a [legacy "figure factory" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [tile-based choropleth maps](/python/tile-county-choropleth).
41
41
42
42
43
43
#### Required Packages
@@ -274,7 +274,7 @@ fig.layout.template = None
274
274
fig.show()
275
275
```
276
276
277
-
Also see Mapbox county choropleths made in Python: [https://plotly.com/python/mapbox-county-choropleth/](https://plotly.com/python/mapbox-county-choropleth/)
277
+
Also see tile county choropleths made in Python: [https://plotly.com/python/tile-county-choropleth/](https://plotly.com/python/tile-county-choropleth/)
Copy file name to clipboardExpand all lines: doc/python/datashader.md
+12-16
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ jupyter:
5
5
text_representation:
6
6
extension: .md
7
7
format_name: markdown
8
-
format_version: '1.2'
9
-
jupytext_version: 1.3.0
8
+
format_version: '1.3'
9
+
jupytext_version: 1.16.3
10
10
kernelspec:
11
-
display_name: Python 3
11
+
display_name: Python 3 (ipykernel)
12
12
language: python
13
13
name: python3
14
14
language_info:
@@ -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.10.0
24
24
plotly:
25
25
description: How to use datashader to rasterize large datasets, and visualize
26
26
the generated raster data with plotly.
@@ -36,10 +36,10 @@ jupyter:
36
36
37
37
[datashader](https://datashader.org/) creates rasterized representations of large datasets for easier visualization, with a pipeline approach consisting of several steps: projecting the data on a regular grid, creating a color representation of the grid, etc.
38
38
39
-
### Passing datashader rasters as a mapbox image layer
39
+
### Passing datashader rasters as a tile map image layer
40
40
41
41
We visualize here the spatial distribution of taxi rides in New York City. A higher density
42
-
is observed on major avenues. For more details about mapbox charts, see [the mapbox layers tutorial](/python/mapbox-layers). No mapbox token is needed here.
42
+
is observed on major avenues. For more details about tile-based maps, see [the tile map layers tutorial](/python/tile-map-layers).
* Non-data marks which can be positioned in paper coordinates, or in data coordinates linked to 2d cartesian subplots:
102
102
*`annotations`: [textual annotations with or without arrows](/python/text-and-annotations/)
103
103
*`shapes`: [lines, rectangles, ellipses or open or closed paths](/python/shapes/)
@@ -181,18 +181,18 @@ The following trace types are compatible with smith subplots via the `smith` att
181
181
182
182
### Map Trace Types and Subplots
183
183
184
-
Figures can include two different types of map subplots: [geo subplots for outline maps](/python/map-configuration/) and [mapbox subplots for tile maps](/python/mapbox-layers/). The following trace types support attributes named `geo` or `mapbox`, whose values must refer to corresponding objects in the layout i.e. `geo="geo2"` etc. Note that attributes such as `layout.geo2` and `layout.mapbox` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.
184
+
Figures can include two different types of map subplots: [geo subplots for outline maps](/python/map-configuration/) and [mapbox subplots for tile maps](/python/tile-map-layers/). The following trace types support attributes named `geo` or `map`, whose values must refer to corresponding objects in the layout i.e. `geo="geo2"` etc. Note that attributes such as `layout.geo2` and `layout.map` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.
185
185
186
186
The following trace types are compatible with geo subplots via the `geo` attribute:
187
187
188
188
*[`scattergeo`](/python/scatter-plots-on-maps/), which can be used to draw [individual markers](/python/scatter-plots-on-maps/), [line and curves](/python/lines-on-maps/) and filled areas on outline maps
189
189
*[`choropleth`](/python/choropleth-maps/): [colored polygons](/python/choropleth-maps/) on outline maps
190
190
191
-
The following trace types are compatible with mapbox subplots via the `mapbox` attribute:
191
+
The following trace types are compatible with tile map subplots via the `map` attribute:
192
192
193
-
*[`scattermapbox`](/python/scattermapbox/), which can be used to draw [individual markers](/python/scattermapbox/), [lines and curves](/python/lines-on-mapbox/) and [filled areas](/python/filled-area-on-mapbox/) on tile maps
194
-
*[`choroplethmapbox`](/python/mapbox-county-choropleth/): colored polygons on tile maps
195
-
*[`densitymapbox`](/python/mapbox-density-heatmaps/): density heatmaps on tile maps
193
+
*[`scattermap`](/python/tile-scatter-maps/), which can be used to draw [individual markers](/python/tile-scatter-maps/), [lines and curves](/python/lines-on-tile-maps/) and [filled areas](/python/filled-area-tile-maps/) on tile maps
194
+
*[`choroplethmap`](/python/tile-county-choropleth/): colored polygons on tile maps
195
+
*[`densitymap`](/python/tile-density-heatmaps/): density heatmaps on tile maps
Copy file name to clipboardExpand all lines: doc/python/heatmaps.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ jupyter:
34
34
thumbnail: thumbnail/heatmap.jpg
35
35
---
36
36
37
-
The term "heatmap" usually refers to a cartesian plot with data visualized as colored rectangular tiles, which is the subject of this page. It is also sometimes used to refer to [actual maps with density data displayed as color intensity](/python/mapbox-density-heatmaps/).
37
+
The term "heatmap" usually refers to a cartesian plot with data visualized as colored rectangular tiles, which is the subject of this page. It is also sometimes used to refer to [actual maps with density data displayed as color intensity](/python/tile-density-heatmaps/).
38
38
39
39
Plotly supports two different types of colored-tile heatmaps:
Copy file name to clipboardExpand all lines: doc/python/hover-text-and-formatting.md
+16-18
Original file line number
Diff line number
Diff line change
@@ -285,7 +285,7 @@ fig.show()
285
285
286
286
### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate
287
287
288
-
This example adds custom fields to a Plotly Express figure using the custom_data parameter and then adds a hover template that applies d3 formats to each element of the customdata[n] array and uses HTML to customize the fonts and spacing.
288
+
This example adds custom fields to a Plotly Express figure using the custom_data parameter and then adds a hover template that applies d3 formats to each element of the customdata[n] array and uses HTML to customize the fonts and spacing.
df.rename(columns={"gdpPercap":'GDP per capita', "lifeExp":'Life Expectancy (years)'}, inplace=True)
303
303
304
-
fig=px.scatter(df,
304
+
fig=px.scatter(df,
305
305
x='GDP per capita',
306
-
y='Life Expectancy (years)',
307
-
color='continent',
308
-
size=np.sqrt(df['pop']),
306
+
y='Life Expectancy (years)',
307
+
color='continent',
308
+
size=np.sqrt(df['pop']),
309
309
# Specifying data to make available to the hovertemplate
310
310
# The px custom_data parameter has an underscore, while the analogous graph objects customdata parameter has no underscore.
311
311
# The px custom_data parameter is a list of column names in the data frame, while the graph objects customdata parameter expects a data frame or a numpy array.
312
-
custom_data=['country', 'continent', 'pop'],
312
+
custom_data=['country', 'continent', 'pop'],
313
313
)
314
314
315
315
# Plotly express does not have a hovertemplate parameter in the graph creation function, so we apply the template with update_traces
316
316
fig.update_traces(
317
-
hovertemplate=
317
+
hovertemplate=
318
318
"<b>%{customdata[0]}</b><br>"+
319
319
"<b>%{customdata[1]}</b><br><br>"+
320
320
"GDP per Capita: %{x:$,.0f}<br>"+
@@ -371,7 +371,7 @@ fig.show()
371
371
372
372
### Advanced Hover Template
373
373
374
-
This produces the same graphic as in "Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate" above, but does so with the `customdata` and `text` parameters of `graph_objects`. It shows how to specify columns from a dataframe to include in the customdata array using the df[["col_i", "col_j"]] subsetting notation. It then references those variables using e.g. %{customdata[0]} in the hovertemplate. It includes comments about major differences between the parameters used by `graph_objects` and `plotly.express`.
374
+
This produces the same graphic as in "Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate" above, but does so with the `customdata` and `text` parameters of `graph_objects`. It shows how to specify columns from a dataframe to include in the customdata array using the df[["col_i", "col_j"]] subsetting notation. It then references those variables using e.g. %{customdata[0]} in the hovertemplate. It includes comments about major differences between the parameters used by `graph_objects` and `plotly.express`.
375
375
376
376
```python
377
377
import plotly.graph_objects as go
@@ -404,12 +404,12 @@ for continent_name, df in continent_data.items():
404
404
name=continent_name,
405
405
406
406
# The next three parameters specify the hover text
407
-
# Text supports just one customized field per trace
408
-
# and is implemented here with text=df['continent'],
409
-
# Custom data supports multiple fields through numeric indices in the hovertemplate
410
-
# In we weren't using the text parameter in our example,
407
+
# Text supports just one customized field per trace
408
+
# and is implemented here with text=df['continent'],
409
+
# Custom data supports multiple fields through numeric indices in the hovertemplate
410
+
# In we weren't using the text parameter in our example,
411
411
# we could instead add continent as a third customdata field.
412
-
customdata=df[['country','pop']],
412
+
customdata=df[['country','pop']],
413
413
hovertemplate=
414
414
"<b>%{customdata[0]}</b><br>"+
415
415
"<b>%{text}</b><br><br>"+
@@ -462,14 +462,12 @@ fig.update_layout(title_text='Hover to see the value of z1, z2 and z3 together')
462
462
fig.show()
463
463
```
464
464
465
-
### Setting the Hover Template in Mapbox Maps
465
+
### Setting the Hover Template in Tile Maps
466
466
467
467
```python
468
468
import plotly.graph_objects as go
469
469
470
-
token =open(".mapbox_token").read() # you need your own token
0 commit comments