diff --git a/doc/python/axes.md b/doc/python/axes.md index e058fbfe7b..4af4bcdefe 100644 --- a/doc/python/axes.md +++ b/doc/python/axes.md @@ -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: diff --git a/doc/python/bar-charts.md b/doc/python/bar-charts.md index 3b2377912d..7a340c7090 100644 --- a/doc/python/bar-charts.md +++ b/doc/python/bar-charts.md @@ -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, @@ -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 diff --git a/doc/python/bubble-maps.md b/doc/python/bubble-maps.md index 3315e934d9..c613ce65d2 100644 --- a/doc/python/bubble-maps.md +++ b/doc/python/bubble-maps.md @@ -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! diff --git a/doc/python/choropleth-maps.md b/doc/python/choropleth-maps.md index d16330a6d6..b8d0098640 100644 --- a/doc/python/choropleth-maps.md +++ b/doc/python/choropleth-maps.md @@ -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() diff --git a/doc/python/configuration-options.md b/doc/python/configuration-options.md index 7e16dc4e62..fdb1bde337 100644 --- a/doc/python/configuration-options.md +++ b/doc/python/configuration-options.md @@ -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 @@ -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( diff --git a/doc/python/creating-and-updating-figures.md b/doc/python/creating-and-updating-figures.md index f5d40ba03e..170fa4d64f 100644 --- a/doc/python/creating-and-updating-figures.md +++ b/doc/python/creating-and-updating-figures.md @@ -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], @@ -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: diff --git a/doc/python/custom-buttons.md b/doc/python/custom-buttons.md index 10f3ab07e2..bee24c678f 100644 --- a/doc/python/custom-buttons.md +++ b/doc/python/custom-buttons.md @@ -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 @@ -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 diff --git a/doc/python/discrete-color.md b/doc/python/discrete-color.md index ed571cd11a..0535d16d14 100644 --- a/doc/python/discrete-color.md +++ b/doc/python/discrete-color.md @@ -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 diff --git a/doc/python/horizontal-bar-charts.md b/doc/python/horizontal-bar-charts.md index 60a6a28686..7f8ceb3116 100644 --- a/doc/python/horizontal-bar-charts.md +++ b/doc/python/horizontal-bar-charts.md @@ -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 diff --git a/doc/python/icicle-charts.md b/doc/python/icicle-charts.md index 38569a7ea0..e1b4eab612 100644 --- a/doc/python/icicle-charts.md +++ b/doc/python/icicle-charts.md @@ -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", diff --git a/doc/python/linear-fits.md b/doc/python/linear-fits.md index 0029be6c4b..948a0732c8 100644 --- a/doc/python/linear-fits.md +++ b/doc/python/linear-fits.md @@ -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). diff --git a/doc/python/ml-knn.md b/doc/python/ml-knn.md index 70f572dc05..cd09c9589f 100644 --- a/doc/python/ml-knn.md +++ b/doc/python/ml-knn.md @@ -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/). @@ -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 diff --git a/doc/python/ml-pca.md b/doc/python/ml-pca.md index 1776d3be39..dfb927316e 100644 --- a/doc/python/ml-pca.md +++ b/doc/python/ml-pca.md @@ -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 diff --git a/doc/python/performance.md b/doc/python/performance.md index b162abaf8d..933fc251d4 100644 --- a/doc/python/performance.md +++ b/doc/python/performance.md @@ -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. diff --git a/doc/python/shapes.md b/doc/python/shapes.md index d8e79260c6..6348002632 100644 --- a/doc/python/shapes.md +++ b/doc/python/shapes.md @@ -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/). diff --git a/doc/python/sliders.md b/doc/python/sliders.md index 2ebe84f040..89c6cfee5a 100644 --- a/doc/python/sliders.md +++ b/doc/python/sliders.md @@ -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 diff --git a/doc/python/splom.md b/doc/python/splom.md index bb9a8a748e..41a1d0950f 100644 --- a/doc/python/splom.md +++ b/doc/python/splom.md @@ -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') diff --git a/doc/python/subplots.md b/doc/python/subplots.md index ce16bdfedd..2a327b1354 100644 --- a/doc/python/subplots.md +++ b/doc/python/subplots.md @@ -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 diff --git a/doc/python/templates.md b/doc/python/templates.md index 070d8633f3..5a0f5f6665 100644 --- a/doc/python/templates.md +++ b/doc/python/templates.md @@ -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 diff --git a/doc/python/text-and-annotations.md b/doc/python/text-and-annotations.md index 3ed95a6d63..3c9934d688 100644 --- a/doc/python/text-and-annotations.md +++ b/doc/python/text-and-annotations.md @@ -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", diff --git a/doc/python/tile-county-choropleth.md b/doc/python/tile-county-choropleth.md index 00162ecedd..c39923bf4f 100644 --- a/doc/python/tile-county-choropleth.md +++ b/doc/python/tile-county-choropleth.md @@ -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: @@ -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 diff --git a/doc/python/tile-map-layers.md b/doc/python/tile-map-layers.md index a60ec6646d..d7c7beb7d7 100644 --- a/doc/python/tile-map-layers.md +++ b/doc/python/tile-map-layers.md @@ -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** @@ -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).