Skip to content

Merge docs changes since last release into master #4290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6d38c8c
Fix typo in marker-style.md
shaido987 Sep 9, 2021
580c5e6
Update 3d-scatter-plots.md
farzinghanbari Oct 12, 2021
ddba96e
Update what_about_dash.md
LiamConnors Aug 16, 2022
ae378e9
Improve syntax and consistency
sdidier-dev Aug 20, 2022
737e466
Merge branch 'master' into update-dash-imports
LiamConnors Apr 14, 2023
1c1d63b
Fixed a typo in figure-factory-subplots.md
RyanDoesMath May 22, 2023
e604d07
Merge branch 'master' into doc-typo_fix
LiamConnors Jun 5, 2023
b4a3565
Merge pull request #4239 from plotly/master
LiamConnors Jun 8, 2023
2bc52ab
Merge branch 'master' into doc-typo_fix
LiamConnors Jun 9, 2023
886d57a
Merge branch 'doc-prod' into doc-typo_fix
LiamConnors Jun 9, 2023
06bba66
Merge branch 'doc-prod' into update-dash-imports
LiamConnors Jun 9, 2023
b9846f5
Merge pull request #3861 from sdidier-dev/doc-configuration-options-p…
LiamConnors Jun 9, 2023
aae423f
Merge pull request #4218 from RyanDoesMath/doc-typo_fix
LiamConnors Jun 9, 2023
3c0ccde
Merge pull request #3856 from plotly/update-dash-imports
LiamConnors Jun 12, 2023
927c756
Merge branch 'doc-prod' into update-docs
LiamConnors Jun 12, 2023
dc2453e
Update legend.md
LiamConnors Jun 12, 2023
eda9231
Merge branch 'doc-prod' into patch-1
LiamConnors Jun 12, 2023
50a2948
Update colorscales.md
LiamConnors Jun 12, 2023
a3d540d
Update shapes.md
LiamConnors Jun 12, 2023
0b64901
Merge pull request #3423 from farzinghanbari/update-docs
LiamConnors Jun 12, 2023
21e99b7
Merge branch 'doc-prod' into update-5-15-examples
LiamConnors Jun 12, 2023
755069f
Merge pull request #3374 from shaido987/patch-1
LiamConnors Jun 14, 2023
f150ff2
Update lines-on-mapbox.md
LiamConnors Jun 14, 2023
2130c10
Update parallel-categories-diagram.md
LiamConnors Jun 14, 2023
57be35c
Update axes.md
LiamConnors Jun 14, 2023
7c719a6
Merge pull request #4248 from plotly/update-links
LiamConnors Jun 14, 2023
8e48b63
Update shapes.md
LiamConnors Jun 16, 2023
d83c369
Update legend.md
LiamConnors Jun 19, 2023
f2840a3
Merge branch 'doc-prod' into update-5-15-examples
LiamConnors Jun 21, 2023
947cbb1
Merge pull request #4245 from plotly/update-5-15-examples
LiamConnors Jun 21, 2023
25662fa
Update map-configuration.md
LiamConnors Jul 11, 2023
7b4f835
Merge pull request #4275 from plotly/update-projections
LiamConnors Jul 11, 2023
5f8d9c2
Update treemaps.md
AtharvaKatre Jul 13, 2023
43ff7c1
Merge pull request #4277 from AtharvaKatre/patch-1
LiamConnors Jul 13, 2023
3ae3ea9
Merge branch 'master' into doc-prod
LiamConnors Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/python/3d-scatter-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',

# tight layout
fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
fig.show()
```

#### 3d scatter plots in Dash
Expand Down
4 changes: 2 additions & 2 deletions doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jupyter:
thumbnail: thumbnail/axes.png
---

This tutorial explain how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](python/reference/layout/xaxis/).
This tutorial explain how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](/python/reference/layout/xaxis/).

Other kinds of subplots and axes are described in other tutorials:

Expand Down Expand Up @@ -154,7 +154,7 @@ fig.update_yaxes(ticklabelposition="inside top", title=None)
fig.show()
```

#### Specifying Label Aliases
#### Specifying Label Aliases

*New in 5.14*

Expand Down
8 changes: 4 additions & 4 deletions doc/python/colorscales.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.5
jupytext_version: 1.14.6
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.10.11
version: 3.10.8
plotly:
description: How to set, create and control continuous color scales and color
bars in scatter, bar, map and heatmap figures.
Expand Down Expand Up @@ -307,11 +307,11 @@ Using `labelalias` you can replace some labels on the `colorbar` with alternativ
```python
import plotly.graph_objects as go

import urllib
import urllib.request as request
import json

# Load heatmap data
response = urllib.request.urlopen(
response = request.urlopen(
"https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json")
dataset = json.load(response)

Expand Down
29 changes: 19 additions & 10 deletions doc/python/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import plotly.graph_objects as go

fig = go.Figure()

config = dict({'scrollZoom': True})
config = {'scrollZoom': True}

fig.add_trace(
go.Scatter(
Expand Down Expand Up @@ -244,6 +244,8 @@ fig.add_trace(
y=[1, 3, 1]))

fig.update_layout(modebar_remove=['zoom', 'pan'])

fig.show()
```

### Add optional shape-drawing buttons to modebar
Expand All @@ -253,16 +255,19 @@ fig.update_layout(modebar_remove=['zoom', 'pan'])
Some modebar buttons of Cartesian plots are optional and have to be added explicitly, using the `modeBarButtonsToAdd` config attribute. These buttons are used for drawing or erasing shapes. See [the tutorial on shapes and shape drawing](python/shapes#drawing-shapes-on-cartesian-plots) for more details.

```python
import plotly.graph_objects as go
import plotly.express as px

df = px.data.iris()

fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')

fig.update_layout(
dragmode='drawopenpath',
newshape_line_color='cyan',
title_text='Draw a path to separate versicolor and virginica'
)
fig.show(config={'modeBarButtonsToAdd':['drawline',

fig.show(config={'modeBarButtonsToAdd': ['drawline',
'drawopenpath',
'drawclosedpath',
'drawcircle',
Expand All @@ -276,10 +281,12 @@ fig.show(config={'modeBarButtonsToAdd':['drawline',
The `layout.modebar.add` attribute can be used instead of the approach used above:

```python
import plotly.graph_objects as go
import plotly.express as px

df = px.data.iris()

fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')

fig.update_layout(
dragmode='drawopenpath',
newshape_line_color='cyan',
Expand All @@ -292,6 +299,8 @@ fig.update_layout(
'eraseshape'
]
)

fig.show()
```

### Double-Click Delay
Expand All @@ -304,12 +313,12 @@ import plotly.graph_objects as go
config = {'doubleClickDelay': 1000}

fig = go.Figure(go.Bar(
y = [3, 5, 3, 2],
x = ["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"],
texttemplate = "%{label}",
textposition = "inside"))
y=[3, 5, 3, 2],
x=["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"],
texttemplate="%{label}",
textposition="inside"))

fig.update_layout(xaxis = {'type': 'date'})
fig.update_layout(xaxis={'type': 'date'})

fig.show(config=config)
```
Expand All @@ -320,4 +329,4 @@ The same configuration dictionary that you pass to the `config` parameter of the

#### Reference

See config options at https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L6
See config options at https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js
2 changes: 1 addition & 1 deletion doc/python/figure-factory-subplots.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Y, X = np.meshgrid(x, y)
u = -1 - X**2 + Y
v = 1 + X - Y**2

fig2 = ff.create_streamline(x, y, u, v, arrow_scale=.1, name='Steamline')
fig2 = ff.create_streamline(x, y, u, v, arrow_scale=.1, name='Streamline')
```

Edit the figures' x and y axes attributes to create subplots:
Expand Down
24 changes: 14 additions & 10 deletions doc/python/legend.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.5
jupytext_version: 1.14.6
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down Expand Up @@ -580,7 +580,7 @@ fig.show()

By default, all traces appear on one legend. To have multiple legends, specify an alternative legend for a trace using the `legend` property. For a second legend, set `legend="legend2"`. Specify more legends with `legend="legend3"`, `legend="legend4"` and so on.

In this example, the last two scatter traces display on the second legend, "legend2". On the figure's layout, we then position and style this legend to display on the right of the graph below the first legend.
In this example, the last two scatter traces display on the second legend, "legend2". On the figure's layout, we then position and style each legend.


```python
Expand Down Expand Up @@ -622,20 +622,25 @@ fig = go.Figure(
],
layout=dict(
title="GDP Per Capita",
legend={"title": "By country", "bgcolor": "Orange",},
legend={
"title": "By country",
"xref": "container",
"yref": "container",
"y": 0.65,
"bgcolor": "Orange",
},
legend2={
"x": 1.155,
"y": 0.55,
"xanchor": "right",
"yanchor": "middle",
"title": "By continent",
"xref": "container",
"yref": "container",
"y": 0.85,
"bgcolor": "Gold",
"title": {"text": "By continent"},

},
),
)

fig.show()

```

### Positioning Legends
Expand Down Expand Up @@ -666,7 +671,6 @@ fig = go.Figure(
"xref": "container",
"yref": "container",
"bgcolor": "Gold",
"title": {"text": "By continent"},
},
),
)
Expand Down
4 changes: 2 additions & 2 deletions doc/python/lines-on-mapbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jupyter:

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.

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://plotly.com/python/reference/scattermapbox/) traces. Below we show you how to draw a line on Mapbox using Plotly Express.
To draw a line on your map, you either can use [`px.line_mapbox()`](https://plotly.com/python-api-reference/generated/plotly.express.line_mapbox.html) in Plotly Express, or [`Scattermapbox`](https://plotly.com/python/reference/scattermapbox/) traces. Below we show you how to draw a line on Mapbox using Plotly Express.

### Lines on Mapbox maps using Plotly Express

Expand Down Expand Up @@ -132,5 +132,5 @@ fig.show()

#### Reference

See [function reference for `px.(line_mapbox)`](https://plotly.com/python-api-reference/generated/plotly.express.line_mapbox) or
See [function reference for `px.(line_mapbox)`](https://plotly.com/python-api-reference/generated/plotly.express.line_mapbox) or
https://plotly.com/python/reference/scattermapbox/ for more information about mapbox and their attribute options.
16 changes: 5 additions & 11 deletions doc/python/map-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.3.1
format_version: '1.3'
jupytext_version: 1.14.7
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.6.8
version: 3.10.4
plotly:
description: How to configure and style base maps for Choropleths and Bubble Maps.
display_as: maps
Expand Down Expand Up @@ -119,9 +119,7 @@ fig.show()

### Map Projections

Geo maps are drawn according to a given map [projection](https://en.wikipedia.org/wiki/Map_projection) that flattens the Earth's roughly-spherical surface into a 2-dimensional space.

The available projections are `'equirectangular'`, `'mercator'`, `'orthographic'`, `'natural earth'`, `'kavrayskiy7'`, `'miller'`, `'robinson'`, `'eckert4'`, `'azimuthal equal area'`, `'azimuthal equidistant'`, `'conic equal area'`, `'conic conformal'`, `'conic equidistant'`, `'gnomonic'`, `'stereographic'`, `'mollweide'`, `'hammer'`, `'transverse mercator'`, `'albers usa'`, `'winkel tripel'`, `'aitoff'` and `'sinusoidal'`.
Geo maps are drawn according to a given map [projection](https://en.wikipedia.org/wiki/Map_projection) that flattens the Earth's roughly-spherical surface into a 2-dimensional space. In the following examples, we show the `'orthographic'` and `'natural earth'` projections, two of the many projection types available. For a full list of available projection types, see the [layout.geo reference documentation](https://plotly.com/python/reference/layout/geo/#layout-geo-projection-type).

```python
import plotly.graph_objects as go
Expand Down Expand Up @@ -221,7 +219,3 @@ fig.show()
### Reference

See https://plotly.com/python/reference/layout/geo/ for more information and chart attribute options!

```python

```
2 changes: 1 addition & 1 deletion doc/python/marker-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ fig.show()

The `marker_symbol` attribute allows you to choose from a wide array of symbols to represent markers in your figures.

The basic symbols are: `circle`, `square`, `diamond`, `cross`, `x`, `triangle`, `pentagon`, `hexagram`, `star`, `diamond`, `hourglass`, `bowtie`, `asterisk`, `hash`, `y`, and `line`.
The basic symbols are: `circle`, `square`, `diamond`, `cross`, `x`, `triangle`, `pentagon`, `hexagram`, `star`, `hourglass`, `bowtie`, `asterisk`, `hash`, `y`, and `line`.

Each basic symbol is also represented by a number. Adding 100 to that number is equivalent to appending the suffix "-open" to a symbol name. Adding 200 is equivalent to appending "-dot" to a symbol name. Adding 300 is equivalent to appending "-open-dot" or "dot-open" to a symbol name.

Expand Down
4 changes: 2 additions & 2 deletions doc/python/parallel-categories-diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For other representations of multivariate data, also see [parallel coordinates](

This example visualizes the restaurant bills of a sample of 244 people. Hovering over a category rectangle (sex, smoker, etc) displays a tooltip with the number of people with that single trait. Hovering over a ribbon in the diagram displays a tooltip with the number of people with a particular combination of the five traits connected by the ribbon.

By default, `px.parallel_categories` will display any column in the `data_frame` that has a cardinality (or number of unique values) of less than 50. This can be overridden either by passing in a specific list of columns to `dimensions` or by setting `dimensions_max_cardinality` to something other than 50.
By default, `px.parallel_categories` will display any column in the `data_frame` that has a cardinality (or number of unique values) of less than 50. This can be overridden either by passing in a specific list of columns to `dimensions` or by setting `dimensions_max_cardinality` to something other than 50.

```python
import plotly.express as px
Expand All @@ -58,7 +58,7 @@ fig.show()

#### Style Diagram

In this example `dimensions` represents a list of stings or the columns of data frame, and `labels` is a dictionary with string keys (column name) and string values ('desired label to be displayed'). See [Plotly express reference page](https://www.plotly.express/plotly_express/#plotly_express.parallel_categories) for more information.
In this example `dimensions` represents a list of stings or the columns of data frame, and `labels` is a dictionary with string keys (column name) and string values ('desired label to be displayed'). See [Plotly express reference page](https://plotly.com/python-api-reference/generated/plotly.express.parallel_categories) for more information.

```python
import plotly.express as px
Expand Down
Loading