diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c59b013df8..4fb2cea7319 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - browser-tools: circleci/browser-tools@1.4.1 + browser-tools: circleci/browser-tools@1.4.3 commands: test_core: diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000000..1d36346c0d4 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 88 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 67cdd158bb2..298927812ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). + +## [5.16.0] - 2023-08-11 + +### Updated +- Updated Plotly.js from version 2.24.1 to version 2.25.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2252----2023-08-11) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include: + - Add "Equal Earth" projection to geo subplots [[#6670](https://github.com/plotly/plotly.js/pull/6670)], + with thanks to @apparebit for the contribution! + - Add options to include legends for shapes and `newshape` [[#6653](https://github.com/plotly/plotly.js/pull/6653)] +- `px` methods now accept data-frame-like objects that support a [dataframe interchange protocol](https://data-apis.org/dataframe-protocol/latest/index.html), such as polars, vaex, modin etc. This protocol has priority on `to_pandas` call, but will only be used if pandas>=2.0.2 is installed in the environment. +- `px` methods now accept data-frame-like objects that support a `toPandas()` method, such as Spark DataFrames, or a `to_pandas_df()` method, such as Vaex DataFrames. + +### Fixed +- Fixed Pandas performance warning issue caused by multiple `frame.insert` [[#4246](https://github.com/plotly/plotly.py/pull/4246)] + ## [5.15.0] - 2023-06-08 ### Updated @@ -16,7 +30,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). this feature was anonymously sponsored: thank you to our sponsor! - Add `legend.xref` and `legend.yref` to enable container-referenced positioning of legends [[#6589](https://github.com/plotly/plotly.js/pull/6589)], with thanks to [Gamma Technologies](https://www.gtisoft.com/) for sponsoring the related development. - Add `colorbar.xref` and `colorbar.yref` to enable container-referenced positioning of colorbars [[#6593](https://github.com/plotly/plotly.js/pull/6593)], with thanks to [Gamma Technologies](https://www.gtisoft.com/) for sponsoring the related development. - - `px` methods now accept data-frame-like objects that support a `to_pandas()` method, such as polars, cudf, vaex etc + - `px` methods now accept data-frame-like objects that support a `to_pandas()` method, such as polars, cudf, vaex etc [[#4244](https://github.com/plotly/plotly.py/pull/4244)], [[#4286](https://github.com/plotly/plotly.py/pull/4286)] ### Fixed - Fixed another compatibility issue with Pandas 2.0, just affecting `px.*(line_close=True)` [[#4190](https://github.com/plotly/plotly.py/pull/4190)] diff --git a/README.md b/README.md index 6eb74df70d5..0616fdf10f5 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ ## Quickstart -`pip install plotly==5.15.0` +`pip install plotly==5.16.0` Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`): @@ -78,13 +78,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is plotly.py may be installed using pip... ``` -pip install plotly==5.15.0 +pip install plotly==5.16.0 ``` or conda. ``` -conda install -c plotly plotly=5.15.0 +conda install -c plotly plotly=5.16.0 ``` ### JupyterLab Support @@ -106,7 +106,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**, ``` # JupyterLab 2.x renderer support -jupyter labextension install jupyterlab-plotly@5.15.0 @jupyter-widgets/jupyterlab-manager +jupyter labextension install jupyterlab-plotly@5.16.0 @jupyter-widgets/jupyterlab-manager ``` Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab. diff --git a/binder/requirements.txt b/binder/requirements.txt index 5e41a8749fb..814d0417bc3 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,5 +1,5 @@ jupytext -plotly==5.14.1 +plotly==5.15.0 jupyter notebook pandas==1.0.3 diff --git a/doc/apidoc/conf.py b/doc/apidoc/conf.py index 2057b92e39a..6793413bcb7 100644 --- a/doc/apidoc/conf.py +++ b/doc/apidoc/conf.py @@ -28,7 +28,7 @@ # The short X.Y version version = "" # The full version, including alpha/beta/rc tags -release = "5.14.1" +release = "5.15.0" # -- General configuration --------------------------------------------------- diff --git a/doc/python/3d-scatter-plots.md b/doc/python/3d-scatter-plots.md index 12b2de61f67..46e389b5654 100644 --- a/doc/python/3d-scatter-plots.md +++ b/doc/python/3d-scatter-plots.md @@ -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 diff --git a/doc/python/axes.md b/doc/python/axes.md index b87e156aace..6b53230ad11 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 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: @@ -154,7 +154,7 @@ fig.update_yaxes(ticklabelposition="inside top", title=None) fig.show() ``` -#### Specifying Label Aliases +#### Specifying Label Aliases *New in 5.14* diff --git a/doc/python/colorscales.md b/doc/python/colorscales.md index fe2ac574227..7e2aeb9ad73 100644 --- a/doc/python/colorscales.md +++ b/doc/python/colorscales.md @@ -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 @@ -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. @@ -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) diff --git a/doc/python/configuration-options.md b/doc/python/configuration-options.md index f0590762fef..52dcc8764ec 100644 --- a/doc/python/configuration-options.md +++ b/doc/python/configuration-options.md @@ -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( @@ -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 @@ -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', @@ -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', @@ -292,6 +299,8 @@ fig.update_layout( 'eraseshape' ] ) + +fig.show() ``` ### Double-Click Delay @@ -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) ``` @@ -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 diff --git a/doc/python/figure-factory-subplots.md b/doc/python/figure-factory-subplots.md index eaaa55b797a..3a6c837692d 100644 --- a/doc/python/figure-factory-subplots.md +++ b/doc/python/figure-factory-subplots.md @@ -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: diff --git a/doc/python/getting-started.md b/doc/python/getting-started.md index 1a971bc46fb..24fecf41317 100644 --- a/doc/python/getting-started.md +++ b/doc/python/getting-started.md @@ -58,13 +58,13 @@ We also encourage you to join the [Plotly Community Forum](http://community.plot `plotly` may be installed using `pip`: ``` -$ pip install plotly==5.14.1 +$ pip install plotly==5.15.0 ``` or `conda`: ``` -$ conda install -c plotly plotly=5.14.1 +$ conda install -c plotly plotly=5.15.0 ``` This package contains everything you need to write figures to standalone HTML files. @@ -152,7 +152,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**, ``` # JupyterLab 2.x renderer support -jupyter labextension install jupyterlab-plotly@5.14.1 @jupyter-widgets/jupyterlab-manager +jupyter labextension install jupyterlab-plotly@5.15.0 @jupyter-widgets/jupyterlab-manager ``` Please check out our [Troubleshooting guide](/python/troubleshooting/) if you run into any problems with JupyterLab, particularly if you are using multiple python environments inside Jupyter. diff --git a/doc/python/legend.md b/doc/python/legend.md index 9ca47748be1..5af51649f83 100644 --- a/doc/python/legend.md +++ b/doc/python/legend.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.14.5 + jupytext_version: 1.14.7 kernelspec: display_name: Python 3 (ipykernel) language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.10.11 + version: 3.10.4 plotly: description: How to configure and style the legend in Plotly with Python. display_as: file_settings @@ -35,7 +35,7 @@ jupyter: ### Trace Types, Legends and Color Bars -[Traces](/python/figure-structure) of most types can be optionally associated with a single legend item in the [legend](/python/legend/). Whether or not a given trace appears in the legend is controlled via the `showlegend` attribute. Traces which are their own subplots (see above) do not support this, with the exception of traces of type `pie` and `funnelarea` for which every distinct color represented in the trace gets a separate legend item. Users may show or hide traces by clicking or double-clicking on their associated legend item. Traces that support legend items also support the `legendgroup` attribute, and all traces with the same legend group are treated the same way during click/double-click interactions. +[Traces](/python/figure-structure) of most types and shapes can be optionally associated with a single legend item in the [legend](/python/legend/). Whether or not a given trace or shape appears in the legend is controlled via the `showlegend` attribute. Traces which are their own subplots (see above) do not support this, with the exception of traces of type `pie` and `funnelarea` for which every distinct color represented in the trace gets a separate legend item. Users may show or hide traces by clicking or double-clicking on their associated legend item. Traces that support legend items and shapes also support the `legendgroup` attribute, and all traces and shapes with the same legend group are treated the same way during click/double-click interactions. The fact that legend items are linked to traces means that when using [discrete color](/python/discrete-color/), a figure must have one trace per color in order to get a meaningful legend. [Plotly Express has robust support for discrete color](/python/discrete-color/) to make this easy. @@ -97,26 +97,66 @@ fig.add_trace(go.Bar(name="fourth", x=["a", "b"], y=[2,1])) fig.show() ``` -*New in v5.0* +*New in 5.16* -The `legendrank` attribute of a trace can be used to control its placement within the legend, without regard for its placement in the `data` list. +If you have shapes that are configured to appear in a legend, these are displayed after all traces: -The default `legendrank` for traces is 1000 and ties are broken as described above, meaning that any trace can be pulled up to the top if it is the only one with a legend rank less than 1000 and pushed to the bottom if it is the only one with a rank greater than 1000. +```python +import plotly.graph_objects as go + +fig = go.Figure() +fig.add_trace(go.Bar(name="first", x=["a", "b"], y=[1, 2])) +fig.add_trace(go.Bar(name="second", x=["a", "b"], y=[2, 1])) +fig.add_shape( + name="first shape", + showlegend=True, + type="rect", + xref="paper", + line=dict(dash="dash"), + x0=0.85, + x1=0.95, + y0=0, + y1=1.5, +) +fig.add_trace(go.Bar(name="third", x=["a", "b"], y=[1, 2])) +fig.add_trace(go.Bar(name="fourth", x=["a", "b"], y=[2, 1])) + +fig.show() + +``` + +The `legendrank` attribute of a trace or shape can be used to control its placement in the legend. +The default `legendrank` for traces and shapes is 1000. When all traces and shapes have the same `legendrank`, traces appear in the order they appear in the data, followed by shapes in the order they are defined. + +Any trace or shape can be pulled up to the top of the legend if it is the only one with a legend rank less than 1000 and pushed to the bottom if it is the only one with a rank greater than 1000. + +In this example, we add a `legendrank` for each trace and shape, giving the shape the lowest rank so it appears first, and moving the first trace defined to the bottom of the legend by giving it the highest rank. ```python import plotly.graph_objects as go fig = go.Figure() -fig.add_trace(go.Bar(name="fourth", x=["a", "b"], y=[2,1], legendrank=4)) -fig.add_trace(go.Bar(name="second", x=["a", "b"], y=[2,1], legendrank=2)) -fig.add_trace(go.Bar(name="first", x=["a", "b"], y=[1,2], legendrank=1)) +fig.add_trace(go.Bar(name="fourth", x=["a", "b"], y=[2,1], legendrank=5)) +fig.add_trace(go.Bar(name="second", x=["a", "b"], y=[2,1], legendrank=4)) +fig.add_trace(go.Bar(name="first", x=["a", "b"], y=[1,2], legendrank=2)) fig.add_trace(go.Bar(name="third", x=["a", "b"], y=[1,2], legendrank=3)) +fig.add_shape( + legendrank=1, + showlegend=True, + type="line", + xref="paper", + line=dict(dash="5px"), + x0=0.05, + x1=0.45, + y0=1.5, + y1=1.5, +) fig.show() ``` #### Showing and Hiding the Legend -By default the legend is displayed on Plotly charts with multiple traces, and this can be explicitly set with the `layout.showlegend` attribute: +By default the legend is displayed on Plotly charts with multiple traces, and this can be explicitly set with the `layout.showlegend` attribute. ```python import plotly.express as px @@ -193,7 +233,7 @@ fig.show() *New in 5.11* -Set the width of horizontal legend entries by setting `entrywidth`. Here we set it to `70` pixels. Pixels is the default unit for `entrywidth`, but you can set it to be a fraction of the plot width using `entrywidthmode='fraction`. +Set the width of horizontal legend entries by setting `entrywidth`. Here we set it to `70` pixels. Pixels is the default unit for `entrywidth`, but you can set it to be a fraction of the plot width using `entrywidthmode='fraction'`. ```python import plotly.express as px @@ -253,7 +293,30 @@ When creating figures using [graph objects](/python/graph-objects/) without usin #### Legend Item Names -Legend items appear per trace, and the legend item name is taken from the trace's `name` attribute. +For traces, legend items appear per trace, and the legend item name is taken from the trace's `name` attribute. + +```python +import plotly.graph_objects as go + +fig = go.Figure() + +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4, 5], + y=[1, 2, 3, 4, 5], + name="Positive" +)) + +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4, 5], + y=[5, 4, 3, 2, 1], + name="Negative" +)) + +fig.show() +``` + +By default, for shapes, legend items are disabled. Set `showlegend=True` on a shape for it to display a legend item. +The name that appears for the shape in the legend is the shape's `name` if it is provided. If no `name` is provided, the shape label's `text` is used. If neither is provided, the legend item appears as "shape \". For example, "shape 1". ```python import plotly.graph_objects as go @@ -272,6 +335,15 @@ fig.add_trace(go.Scatter( name="Negative" )) +fig.add_shape( + showlegend=True, + type="rect", + x0=2, + x1=4, + y0=4.5, + y1=5, +) + fig.show() ``` @@ -324,7 +396,7 @@ fig.show() #### Hiding the Trace Initially -Traces have a `visible` attribute. If set to `legendonly`, the trace is hidden from the graph implicitly. Click on the name in the legend to display the hidden trace. +Traces and shapes have a `visible` attribute. If set to `legendonly`, the trace or shape is hidden from the graph implicitly. Click on the name in the legend to display the hidden trace or shape. ```python import plotly.graph_objects as go @@ -578,9 +650,9 @@ fig.show() *New in 5.15* -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. +By default, all traces and shapes appear on one legend. To have multiple legends, specify an alternative legend for a trace or shape 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 @@ -622,20 +694,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 @@ -666,7 +743,6 @@ fig = go.Figure( "xref": "container", "yref": "container", "bgcolor": "Gold", - "title": {"text": "By continent"}, }, ), ) diff --git a/doc/python/lines-on-mapbox.md b/doc/python/lines-on-mapbox.md index 1a56296724f..3d7bc953175 100644 --- a/doc/python/lines-on-mapbox.md +++ b/doc/python/lines-on-mapbox.md @@ -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 @@ -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. diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index 5a2f5a349f6..6e9f54e4d7e 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -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: @@ -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 @@ -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 @@ -221,7 +219,3 @@ fig.show() ### Reference See https://plotly.com/python/reference/layout/geo/ for more information and chart attribute options! - -```python - -``` \ No newline at end of file diff --git a/doc/python/marker-style.md b/doc/python/marker-style.md index 128b22d04c5..21b0a2ac052 100644 --- a/doc/python/marker-style.md +++ b/doc/python/marker-style.md @@ -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. diff --git a/doc/python/parallel-categories-diagram.md b/doc/python/parallel-categories-diagram.md index 11ac1f3e410..51ecd4168bb 100644 --- a/doc/python/parallel-categories-diagram.md +++ b/doc/python/parallel-categories-diagram.md @@ -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 @@ -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 diff --git a/doc/python/plotly-express.md b/doc/python/plotly-express.md index 4a3327c848d..4e4c30e8f31 100644 --- a/doc/python/plotly-express.md +++ b/doc/python/plotly-express.md @@ -5,10 +5,10 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: '1.2' - jupytext_version: 1.4.2 + 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: @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.7.7 + version: 3.10.4 plotly: description: Plotly Express is a terse, consistent, high-level API for creating figures. @@ -42,8 +42,7 @@ Plotly Express provides [more than 30 functions for creating different types of Here is a talk from the [SciPy 2021 conference](https://www.scipy2021.scipy.org/) that gives a good introduction to Plotly Express and [Dash](https://dash.plotly.com/): -```python hide_code=true -%%html +```html hide_code=true