Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion 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 explains 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/yaxis/).

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

Expand Down
4 changes: 2 additions & 2 deletions doc/python/bar-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def pictogram_bar(data, title, icon_size, max_icons_per_column=10, units_per_ico
title=title,
xaxis=dict(
tickvals=tick_locations,
# Label ecah category
# Label each category
ticktext=list(data.keys()),
tickangle=-45,
showgrid=False,
Expand Down Expand Up @@ -772,7 +772,7 @@ fig.show()

### Colored and Styled Bar Chart

In this example several parameters of the layout as customized, hence it is convenient to use directly the `go.Layout(...)` constructor instead of calling `fig.update`.
In this example several parameters of the layout are customized, hence it is convenient to use directly the `go.Layout(...)` constructor instead of calling `fig.update`.

```python
import plotly.graph_objects as go
Expand Down
2 changes: 1 addition & 1 deletion doc/python/bubble-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@ fig.show()

#### Reference

See [function reference for `px.(scatter_geo)`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_geo) or https://plotly.com/python/reference/choropleth/ and https://plotly.com/python/reference/scattergeo/ for more information and chart attribute options!
See [function reference for `px.scatter_geo`](https://plotly.com/python-api-reference/generated/plotly.express.scatter_geo) or https://plotly.com/python/reference/scattergeo/ for more information and chart attribute options!
2 changes: 1 addition & 1 deletion doc/python/choropleth-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fig = go.Figure(data=go.Choropleth(

fig.update_layout(
title_text = '2011 US Agriculture Exports by State',
geo_scope='usa', # limite map scope to USA
geo_scope='usa', # limit map scope to USA
)

fig.show()
Expand Down
4 changes: 2 additions & 2 deletions doc/python/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The `.show()` method that you use to display your figures also accepts a `config

You can set the configuration options for your figure by passing a dictionary to this parameter which contains the options you want to set.

If you don't set an option's value, it will be automatically be set to the default value for that option.
If you don't set an option's value, it will automatically be set to the default value for that option.

For the complete list of configuration options and their defaults see: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js

Expand Down Expand Up @@ -348,7 +348,7 @@ fig = go.Figure(
title='Google Stock Price Over Time with Mode Bar Disabled',
xaxis=dict(
title='Date',
# Try zooming in or out using the modebar buttons. These only apply to the yaxis in this exampe.
# Try zooming in or out using the modebar buttons. These only apply to the yaxis in this example.
modebardisable='zoominout'
),
yaxis=dict(
Expand Down
4 changes: 2 additions & 2 deletions doc/python/creating-and-updating-figures.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ import plotly.graph_objects as go
df = px.data.iris()

fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", facet_col="species",
title="Adding Traces To Subplots Witin A Plotly Express Figure")
title="Adding Traces To Subplots Within A Plotly Express Figure")

reference_line = go.Scatter(x=[2, 4],
y=[4, 8],
Expand Down Expand Up @@ -624,7 +624,7 @@ Figures created with the plotly.py graphing library also support:

#### Chaining Figure Operations

All of the figure update operations described above are methods that return a reference to the figure being modified. This makes it possible the chain multiple figure modification operations together into a single expression.
All of the figure update operations described above are methods that return a reference to the figure being modified. This makes it possible to chain multiple figure modification operations together into a single expression.

Here is an example of a chained expression that creates:

Expand Down
6 changes: 3 additions & 3 deletions doc/python/custom-buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jupyter:
---

#### Methods
The [updatemenu method](https://plot.ly/python/reference/layout/updatemenus/#layout-updatemenus-items-updatemenu-buttons-items-button-method) determines which [plotly.js function](https://plot.ly/javascript/plotlyjs-function-reference/) will be used to modify the chart. There are 4 possible methods:
The [updatemenu method](https://plotly.com/python/reference/layout/updatemenus/#layout-updatemenus-items-updatemenu-buttons-items-button-method) determines which [plotly.js function](https://plotly.com/javascript/plotlyjs-function-reference/) will be used to modify the chart. There are 4 possible methods:
- `"restyle"`: modify **data** or data attributes
- `"relayout"`: modify **layout** attributes
- `"update"`: modify **data and layout** attributes; combination of `"restyle"` and `"relayout"`
- `"animate"`: start or pause an [animation](https://plot.ly/python/#animations))
- `"animate"`: start or pause an [animation](https://plotly.com/python/#animations))


#### Restyle Button
Expand Down Expand Up @@ -146,7 +146,7 @@ fig.update_scenes(
aspectmode="manual"
)

# Add drowdowns
# Add dropdowns
# button_layer_1_height = 1.08
button_layer_1_height = 1.12
button_layer_2_height = 1.065
Expand Down
2 changes: 1 addition & 1 deletion doc/python/discrete-color.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fig = px.bar(df, y="continent", x="pop", color="continent", orientation="h", hov
fig.show()
```

**_Warning_**: If your color sequence is has fewer colors than the number of unique values in the column you are mapping to `color`, the colors will cycle through and repeat, possibly leading to ambiguity:
**_Warning_**: If your color sequence has fewer colors than the number of unique values in the column you are mapping to `color`, the colors will cycle through and repeat, possibly leading to ambiguity:

```python
import plotly.express as px
Expand Down
2 changes: 1 addition & 1 deletion doc/python/horizontal-bar-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ See more examples of bar charts (including vertical bar charts) and styling opti

### Horizontal Bar Chart with Plotly Express

[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/). For a horizontal bar char, use the `px.bar` function with `orientation='h'`.
[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/). For a horizontal bar chart, use the `px.bar` function with `orientation='h'`.

#### Basic Horizontal Bar Chart with Plotly Express

Expand Down
2 changes: 1 addition & 1 deletion doc/python/icicle-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fig =go.Figure(go.Icicle(
"North America", "Europe", "Australia", "North America - Football", "Soccer",
"North America - Rugby", "Europe - Football", "Rugby",
"Europe - American Football","Australia - Football", "Association",
"Australian Rules", "Autstralia - American Football", "Australia - Rugby",
"Australian Rules", "Australia - American Football", "Australia - Rugby",
"Rugby League", "Rugby Union"
],
labels= ["Sports",
Expand Down
2 changes: 1 addition & 1 deletion doc/python/linear-fits.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fig = px.scatter(df, x="gdpPercap", y="lifeExp", log_x=True,
fig.show()
```

### Locally WEighted Scatterplot Smoothing (LOWESS)
### Locally Weighted Scatterplot Smoothing (LOWESS)

Plotly Express also supports non-linear [LOWESS](https://en.wikipedia.org/wiki/Local_regression) trendlines. In order use this feature, you will need to [install `statsmodels` and its dependencies](https://www.statsmodels.org/stable/install.html).

Expand Down
3 changes: 2 additions & 1 deletion doc/python/ml-knn.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fig.show()

Just like the previous example, we will first train our kNN model on the training set.

Instead of predicting the conference for the test set, we can predict the confidence map for the entire area that wraps around the dimensions of our dataset. To do this, we use [`np.meshgrid`](https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html) to create a grid, where the distance between each point is denoted by the `mesh_size` variable.
Instead of predicting the confidence for the test set, we can predict the confidence map for the entire area that wraps around the dimensions of our dataset. To do this, we use [`np.meshgrid`](https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html) to create a grid, where the distance between each point is denoted by the `mesh_size` variable.

Then, for each of those points, we will use our model to give a confidence score, and plot it with a [contour plot](https://plotly.com/python/contour-plots/).

Expand Down Expand Up @@ -264,6 +264,7 @@ import plotly.express as px
import plotly.graph_objects as go
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split

mesh_size = .02
margin = 1
Expand Down
1 change: 1 addition & 0 deletions doc/python/ml-pca.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ For more details about the linear algebra behind eigenvectors and loadings, see

```python
import plotly.express as px
import numpy as np
from sklearn.decomposition import PCA
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
Expand Down
2 changes: 1 addition & 1 deletion doc/python/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ it is also possible to use [datashader](/python/datashader/).

The `render_mode` argument to supported Plotly Express functions (e.g. `scatter` and `scatter_polar`) can be used to enable WebGL rendering.

> **Note** The default `render_mode` is `"auto"`, in which case Plotly Express will automatically set `render_mode="webgl"` if the input data is more than 1,000 rows long. In this case, WebGl can be disabled by setting `render_mode=svg`.
> **Note** The default `render_mode` is `"auto"`, in which case Plotly Express will automatically set `render_mode="webgl"` if the input data is more than 1,000 rows long. In this case, WebGL can be disabled by setting `render_mode=svg`.

Here is an example that creates a 100,000 point scatter plot using Plotly Express with WebGL rendering explicitly enabled.

Expand Down
2 changes: 1 addition & 1 deletion doc/python/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ As a general rule, there are two ways to add shapes (lines or polygons) to figur
The differences between these two approaches are that:
* Traces can optionally support hover labels and can appear in legends.
* Shapes can be positioned absolutely or relative to data coordinates in 2d cartesian subplots only.
* Traces cannot be positioned absolutely but can be positioned relative to date coordinates in any subplot type.
* Traces cannot be positioned absolutely but can be positioned relative to data coordinates in any subplot type.
* Traces also support [optional text](/python/text-and-annotations/), although there is a [textual equivalent to shapes in text annotations](/python/text-and-annotations/).


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

#### Methods
The method determines which [plotly.js function](https://plot.ly/javascript/plotlyjs-function-reference/) will be used to update the chart. Plotly can use several [updatemenu](https://plot.ly/python/reference/layout/updatemenus/#layout-updatemenus-items-updatemenu-buttons-items-button-method) methods to add the slider:
The method determines which [plotly.js function](https://plotly.com/javascript/plotlyjs-function-reference/) will be used to update the chart. Plotly can use several [updatemenu](https://plotly.com/python/reference/layout/updatemenus/#layout-updatemenus-items-updatemenu-buttons-items-button-method) methods to add the slider:
- `"update"`: modify **data and layout** attributes (as above)
- `"restyle"`: modify **data** attributes
- `"relayout"`: modify **layout** attributes
Expand Down
2 changes: 1 addition & 1 deletion doc/python/splom.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ fig.show()
Diabetes dataset is downloaded from [kaggle](https://www.kaggle.com/uciml/pima-indians-diabetes-database/data). It is used to predict the onset of diabetes based on 8 diagnostic measures. The diabetes file contains the diagnostic measures for 768 patients, that are labeled as non-diabetic (Outcome=0), respectively diabetic (Outcome=1). The splom associated to the 8 variables can illustrate the strength of the relationship between pairs of measures for diabetic/nondiabetic patients.

```python
import plotly.graph_objs as go
import plotly.graph_objects as go
import pandas as pd

dfd = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/diabetes.csv')
Expand Down
2 changes: 1 addition & 1 deletion doc/python/subplots.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jupyter:
pygments_lexer: ipython3
version: 3.11.10
plotly:
description: How to make subplots in with Plotly's Python graphing library. Examples
description: How to make subplots with Plotly's Python graphing library. Examples
of stacked, custom-sized, gridded, and annotated subplots.
display_as: file_settings
language: python
Expand Down
2 changes: 1 addition & 1 deletion doc/python/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jupyter:

The Plotly Python library comes pre-loaded with several themes that you can get started using right away, and it also provides support for creating and registering your own themes.

> Note on terminology: Theming generally refers to the process of defining default styles for visual elements. Themes in plotly are implemented using objects called templates. Templates are slightly more general than traditional themes because in addition to defining default styles, templates can pre-populate a figure with visual elements like annotations, shapes, images, and more. In the documentation we will refer to the overall process of defining default styles as theming, and when in comes to the plotly API we will talk about how themes are implemented using templates.
> Note on terminology: Theming generally refers to the process of defining default styles for visual elements. Themes in plotly are implemented using objects called templates. Templates are slightly more general than traditional themes because in addition to defining default styles, templates can pre-populate a figure with visual elements like annotations, shapes, images, and more. In the documentation we will refer to the overall process of defining default styles as theming, and when it comes to the plotly API we will talk about how themes are implemented using templates.

### Using built-in themes

Expand Down
2 changes: 1 addition & 1 deletion doc/python/text-and-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ fig.add_trace(go.Scattergeo(
name="",
text=["Montreal", "Toronto", "Vancouver", "Calgary", "Edmonton", "Ottawa",
"Halifax",
"Victoria", "Winnepeg", "Regina"],
"Victoria", "Winnipeg", "Regina"],
textfont={
"color": ["MidnightBlue", "IndianRed", "MediumPurple", "Gold", "Crimson",
"LightSeaGreen",
Expand Down
4 changes: 2 additions & 2 deletions doc/python/tile-county-choropleth.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ IFrame(snippet_url + 'mapbox-county-choropleth', width='100%', height=1200)

### Indexing by GeoJSON Properties

If the GeoJSON you are using either does not have an `id` field or you wish you use one of the keys in the `properties` field, you may use the `featureidkey` parameter to specify where to match the values of `locations`.
If the GeoJSON you are using either does not have an `id` field or you wish to use one of the keys in the `properties` field, you may use the `featureidkey` parameter to specify where to match the values of `locations`.

In the following GeoJSON object/data-file pairing, the values of `properties.district` match the values of the `district` column:

Expand Down Expand Up @@ -226,7 +226,7 @@ The earlier examples using `px.choropleth_map` and `go.Choroplethmap` use [Mapli

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.

Here's an exmaple of using the Mapbox Light base map, which requires a free token.
Here's an example of using the Mapbox Light base map, which requires a free token.

```python
token = open(".mapbox_token").read() # you will need your own token
Expand Down
4 changes: 2 additions & 2 deletions doc/python/tile-map-layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Plotly supports two different kinds of maps:

- **[Tile-based maps](https://en.wikipedia.org/wiki/Tiled_web_map)**

If your figure is created with a `px.scatter_map`, `px_scatter_mapbox`, `px.line_map`, `px.line_mapbox`, `px.choropleth_map`, `px.choropleth_mapbox`, `px.density_map`, or `px.density_mapbox` function or otherwise contains one or more traces of type `go.Scattermap`, `go.Scattermapbox`, `go.Choroplethmap`, `go.Choroplethmapbox`, `go.Densitymap`, or `go.Densitymapbox`, the `layout.map` or `layout.mapbox` object in your figure contains configuration information for the map itself.
If your figure is created with a `px.scatter_map`, `px.scatter_mapbox`, `px.line_map`, `px.line_mapbox`, `px.choropleth_map`, `px.choropleth_mapbox`, `px.density_map`, or `px.density_mapbox` function or otherwise contains one or more traces of type `go.Scattermap`, `go.Scattermapbox`, `go.Choroplethmap`, `go.Choroplethmapbox`, `go.Densitymap`, or `go.Densitymapbox`, the `layout.map` or `layout.mapbox` object in your figure contains configuration information for the map itself.

- **Outline-based maps**

Expand Down Expand Up @@ -228,7 +228,7 @@ fig.show()

Mapbox tile maps are composed of various layers, of three different types:

1. `layout.mapbox.style` defines is the lowest layers, also known as your "base map"
1. `layout.mapbox.style` defines the lowest layers, also known as your "base map"
2. The various traces in `data` are by default rendered above the base map (although this can be controlled via the `below` attribute).
3. `layout.mapbox.layers` is an array that defines more layers that are by default rendered above the traces in `data` (although this can also be controlled via the `below` attribute).

Expand Down