From 4911830f675818061cc03493ba75341c828e268e Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Mon, 7 Jul 2025 12:13:37 -0400 Subject: [PATCH 01/17] Add zero line layer example --- doc/python/axes.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/doc/python/axes.md b/doc/python/axes.md index df8672e0e2e..b0713283f4f 100644 --- a/doc/python/axes.md +++ b/doc/python/axes.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.16.3 + jupytext_version: 1.17.2 kernelspec: display_name: Python 3 (ipykernel) language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.10.14 + version: 3.9.0 plotly: description: How to adjust axes properties in Python - axes titles, styling and coloring axes and grid lines, ticks, tick labels and more. @@ -619,6 +619,38 @@ fig.update_yaxes(zeroline=True, zerolinewidth=2, zerolinecolor='LightPink') fig.show() ``` +##### Controlling zero line layer + +*New in 6.3* + +By default, zero lines are displayed below traces. Set `zerolinelayer="above traces"` on an axis to display its zero line above traces: + +```python +import plotly.graph_objects as go + +x = ['A', 'B', 'C', 'D', 'A'] +y = [2, 0, 4, -3, 2] + +fig = go.Figure( + data=[ + go.Scatter( + x=x, + y=y, + fill='toself', + mode='none', + fillcolor='lightpink' + ) + ], + layout=dict( + yaxis=dict( + zerolinelayer="above traces" # Change to "below traces" to see the difference + ), + ) +) + +fig.show() +``` + #### Setting the Range of Axes Manually The visible x and y axis range can be configured manually by setting the `range` axis property to a list of two values, the lower and upper bound. From 34655294e4e26bf287b8d9412353acd2ee86c99b Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Mon, 7 Jul 2025 13:09:38 -0400 Subject: [PATCH 02/17] add pattern path example --- doc/python/pattern-hatching-texture.md | 53 +++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/doc/python/pattern-hatching-texture.md b/doc/python/pattern-hatching-texture.md index 25d77571631..ec5649eb325 100644 --- a/doc/python/pattern-hatching-texture.md +++ b/doc/python/pattern-hatching-texture.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.14.6 + jupytext_version: 1.17.2 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.9.0 plotly: description: How to use patterns (also known as hatching or texture) with bar charts. @@ -150,6 +150,55 @@ fig.add_trace(go.Bar(x=["a","b"], y=[2,3], marker_pattern_shape="+")) fig.show() ``` +### Patterns Using SVG Paths + +*New in 6.3* + +You can make custom patterns for graphs by using an SVG path. Set `marker.pattern.path` to the SVG path to use: + +```python +import plotly.graph_objects as go +import plotly.data + +df = plotly.data.gapminder().query("year == 2007 and continent == 'Europe'").copy() +df['gdp'] = df['gdpPercap'] * df['pop'] +df = df.sort_values('gdp', ascending=False).head(4) + +fig = go.Figure( + data=[go.Bar( + x=df['country'], + y=df['gdp'], + marker=dict( + color=["lightsteelblue", "mistyrose", "palegreen", "thistle"], + pattern=dict( + path=[ + "M0,0H4V4H0Z", + "M0,0H6V6Z", + "M0,0V4H4Z", + "M0,0C0,2,4,2,4,4C4,6,0,6,0,8H2C2,6,6,6,6,4C6,2,2,2,2,0Z" + ], + fgcolor=["midnightblue", "crimson", "seagreen", "indigo"], + bgcolor=["mintcream", "lavenderblush", "azure", "honeydew"], + size=20, + solidity=0.7 + ) + ), + name="GDP (2007)" + )], + layout=dict( + title="Top 4 European Countries by GDP (Gapminder 2007) with Custom SVG Path Patterns", + xaxis_title="Country", + yaxis_title="GDP (USD)", + yaxis_tickformat="$.2s", + width=800, + height=500, + bargap=0.3 + ) +) + +fig.show() +``` + #### Reference See https://plotly.com/python/reference/bar/ for more information and chart attribute options! From ec640bd0d53b73c8cb2fcdb0eaead5aed332391f Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Mon, 7 Jul 2025 13:46:49 -0400 Subject: [PATCH 03/17] add max height example --- doc/python/legend.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/doc/python/legend.md b/doc/python/legend.md index d9042bb97a8..3f803df40b8 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.16.1 + jupytext_version: 1.17.2 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.9.0 plotly: description: How to configure and style the legend in Plotly with Python. display_as: file_settings @@ -254,6 +254,46 @@ fig.update_layout(legend=dict( fig.show() ``` +#### Legend Max Height + +*New in 6.3* + +By default, a legend can expand to fill up to half of the layout area height for a horizontal legend and the full height for a vertical legend. You can specify the maximum height of a legend with the `maxheight` parameter. In the following plot with many legend items, we set `maxheight` to a ratio of 0.10, giving the plot more space. + +```python +import plotly.express as px +from plotly import data + +df = data.gapminder().query("year==2007 and continent == 'Europe'") + +fig = px.scatter(df, + x="gdpPercap", + y="lifeExp", + color="country", + size="pop", + size_max=45, + title="Life Expectancy vs. GDP per Capita in 2007 (by Country)", + labels={"gdpPercap": "GDP per Capita"}, + ) + +fig.update_layout( + xaxis=dict( + side="top" + ), + legend=dict( + orientation="h", + yanchor="bottom", + y=-0.35, + xanchor="center", + x=0.5, + maxheight=0.1, # Comment maxheight to see legend take up 0.5 of plotting area + title_text="Country" + ), +) + +fig.show() +``` + #### Styling Legends Legends support many styling options. From d9ec8166126c77008a230519b1b4aa2a46b1c39b Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 29 Jul 2025 11:15:52 -0400 Subject: [PATCH 04/17] Add modebar button disable example --- doc/python/configuration-options.md | 44 ++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/doc/python/configuration-options.md b/doc/python/configuration-options.md index a7ffd46fed8..81584acccd1 100644 --- a/doc/python/configuration-options.md +++ b/doc/python/configuration-options.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.17.2 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.12.4 plotly: description: How to set the configuration options of figures using the Plotly Python graphing library. @@ -323,6 +323,42 @@ fig.update_layout(xaxis={'type': 'date'}) fig.show(config=config) ``` +### Disabling Buttons for Specific Axes + +*New in 6.3* + +Disabling the zoom in, zoom out, and autoscale buttons for specific axes is supported on cartesian axes using the `modebardisable` attribute. In the following example, the zoom in and zoom out buttons are disabled on the `xaxis`, meaning these buttons only zoom in and out on the `yaxis`. Disable the autoscale button using `modebardisable='autoscale'`. You can also disable both autoscaling and zoom buttons using `modebardisable='zoominout+autoscale'`. + +```python +import plotly.graph_objects as go +import plotly.data + +df = plotly.data.stocks() + +fig = go.Figure( + data=[ + go.Scatter( + x=df['date'], + y=df['GOOG'], + mode='lines+markers', + name='Google Stock Price' + ) + ], + layout=go.Layout( + 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. + modebardisable='zoominout' + ), + yaxis=dict( + title='Stock Price (USD)', + ) + ) +) +fig.show() +``` + ### Configuring Figures in Dash Apps The same configuration dictionary that you pass to the `config` parameter of the `show()` method can also be passed to the [`config` property of a `dcc.Graph` component](https://dash.plotly.com/dash-core-components/graph). From f19bbf887acd12a27ec5bde320a70bef2dc87eda Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 29 Jul 2025 11:24:37 -0400 Subject: [PATCH 05/17] Add Minor Log Labels example --- doc/python/log-plot.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/python/log-plot.md b/doc/python/log-plot.md index 27d19febd1b..a3c1118eb86 100644 --- a/doc/python/log-plot.md +++ b/doc/python/log-plot.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.13.7 + jupytext_version: 1.17.2 kernelspec: display_name: Python 3 (ipykernel) language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.9.7 + version: 3.12.4 plotly: description: How to make Log plots in Python with Plotly. display_as: scientific @@ -80,6 +80,28 @@ fig.update_xaxes(minor=dict(ticks="inside", ticklen=6, showgrid=True)) fig.show() ``` +#### Controlling Minor Log Labels + +*New in 6.3* + +By default, minor log labels use small digits, as shown in the previous example. You can control how minor log labels are displayed using the `minorloglabels` attribute. Set to `"complete"` to show complete digits, or `None` for no labels. + +```python +import plotly.express as px +df = px.data.gapminder().query("year == 2007") + +fig = px.scatter( + df, x="gdpPercap", + y="lifeExp", + hover_name="country", + log_x=True, range_x=[1,100000], range_y=[0,100]) + +fig.update_xaxes(minor=dict(ticks="inside", ticklen=6, showgrid=True), + minorloglabels="complete") + +fig.show() +``` + ### Logarithmic Axes with Graph Objects If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Figure` class from `plotly.graph_objects`](/python/graph-objects/). From 2ecd080e490b295256a7854040cd10da1ccee5fe Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 29 Jul 2025 12:41:36 -0400 Subject: [PATCH 06/17] Add unifiedhovertitle example --- doc/python/hover-text-and-formatting.md | 55 ++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/doc/python/hover-text-and-formatting.md b/doc/python/hover-text-and-formatting.md index 068095c69e7..cdbc4058daf 100644 --- a/doc/python/hover-text-and-formatting.md +++ b/doc/python/hover-text-and-formatting.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.16.1 + jupytext_version: 1.17.2 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.12.4 plotly: description: How to use hover text and formatting in Python with Plotly. display_as: file_settings @@ -83,6 +83,57 @@ fig.update_layout(hovermode="x unified") fig.show() ``` +#### Customize Title in Unified Hovermode + +*New in 6.3* + +Customize the title shown in unified hovermode, by specifing `unifiedhovertitle.text`. + +The unified hover title is a template string that supports using variables from the data. Numbers are formatted using d3-format's syntax `%{variable:d3-format}`, for `example \"Price: %{y:$.2f}\"`. Dates are formatted using d3-time-format's syntax `%{variable|d3-time-format}`, for example `\"Day: %{2019-01-01|%A}\"`. + +The following example uses `'x unified'` hover and specifies a unified hover title that shows the full weekday, month, day, and year. + +```python +import plotly.graph_objects as go +import plotly.express as px + +df = px.data.stocks() + +fig = go.Figure( + data=[ + go.Scatter( + x=df['date'], + y=df['GOOG'], + mode='lines', + name='Google' + ), + go.Scatter( + x=df['date'], + y=df['AAPL'], + mode='lines', + name='Apple' + ) + ], + layout=go.Layout( + title_text="Stock Prices with Custom Unified Hover Title", + hovermode='x unified', + xaxis=dict( + title_text='Date', + unifiedhovertitle=dict( + text='%{x|%A, %B %d, %Y}' + ) + ), + yaxis=dict( + title_text='Price (USD)', + tickprefix='$' + ) + ) +) + +fig.show() + +``` + #### Control hovermode with Dash [Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`. From 60a377c9a674b47a1df3fb06966c318b5c975d85 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 29 Jul 2025 12:41:54 -0400 Subject: [PATCH 07/17] Make small formatting changes --- doc/python/axes.md | 2 +- doc/python/legend.md | 12 ++++++------ doc/python/log-plot.md | 18 ++++++++++++++---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/doc/python/axes.md b/doc/python/axes.md index b0713283f4f..82dca682b22 100644 --- a/doc/python/axes.md +++ b/doc/python/axes.md @@ -619,7 +619,7 @@ fig.update_yaxes(zeroline=True, zerolinewidth=2, zerolinecolor='LightPink') fig.show() ``` -##### Controlling zero line layer +##### Controlling Zero Line Layer *New in 6.3* diff --git a/doc/python/legend.md b/doc/python/legend.md index 3f803df40b8..04de7c25b73 100644 --- a/doc/python/legend.md +++ b/doc/python/legend.md @@ -258,7 +258,7 @@ fig.show() *New in 6.3* -By default, a legend can expand to fill up to half of the layout area height for a horizontal legend and the full height for a vertical legend. You can specify the maximum height of a legend with the `maxheight` parameter. In the following plot with many legend items, we set `maxheight` to a ratio of 0.10, giving the plot more space. +By default, a legend can expand to fill up to half of the layout area height for a horizontal legend and the full height for a vertical legend. You can change this by specifying a `maxheight` for the legend. In the following plot with many legend items, we set `maxheight` to a ratio of 0.10, giving the plot more space. ```python import plotly.express as px @@ -266,12 +266,12 @@ from plotly import data df = data.gapminder().query("year==2007 and continent == 'Europe'") -fig = px.scatter(df, - x="gdpPercap", - y="lifeExp", +fig = px.scatter(df, + x="gdpPercap", + y="lifeExp", color="country", - size="pop", - size_max=45, + size="pop", + size_max=45, title="Life Expectancy vs. GDP per Capita in 2007 (by Country)", labels={"gdpPercap": "GDP per Capita"}, ) diff --git a/doc/python/log-plot.md b/doc/python/log-plot.md index a3c1118eb86..42cefc8b07d 100644 --- a/doc/python/log-plot.md +++ b/doc/python/log-plot.md @@ -88,16 +88,26 @@ By default, minor log labels use small digits, as shown in the previous example. ```python import plotly.express as px + df = px.data.gapminder().query("year == 2007") fig = px.scatter( df, x="gdpPercap", y="lifeExp", hover_name="country", - log_x=True, range_x=[1,100000], range_y=[0,100]) - -fig.update_xaxes(minor=dict(ticks="inside", ticklen=6, showgrid=True), - minorloglabels="complete") + log_x=True, + range_x=[1,100000], + range_y=[0,100] +) + +fig.update_xaxes( + minor=dict( + ticks="inside", + ticklen=6, + showgrid=True + ), + minorloglabels="complete" +) fig.show() ``` From 3ecefefa7d8288d94d2e93ea4de4fcaafd942f5d Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 5 Aug 2025 15:05:19 -0400 Subject: [PATCH 08/17] add map updates --- doc/python/choropleth-maps.md | 9 +++++---- doc/python/map-configuration.md | 14 +++++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/doc/python/choropleth-maps.md b/doc/python/choropleth-maps.md index e38e51befde..c4ff93cfd0d 100644 --- a/doc/python/choropleth-maps.md +++ b/doc/python/choropleth-maps.md @@ -208,15 +208,16 @@ fig.show() Plotly comes with two built-in geometries which do not require an external GeoJSON file: 1. USA States -2. Countries as defined in the Natural Earth dataset. +2. Countries -**Note and disclaimer:** cultural (as opposed to physical) features are by definition subject to change, debate and dispute. Plotly includes data from Natural Earth "as-is" and defers to the [Natural Earth policy regarding disputed borders](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/) which read: +In **Plotly.py 6.3 and later**, the built-in countries geometry is created from the following sources: +- [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. +- Natural Earth data for oceans, lakes, rivers, and subunit layers. -> Natural Earth Vector draws boundaries of countries according to defacto status. We show who actually controls the situation on the ground. +In **earlier versions of Plotly.py**, the built-in countries geometry is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). To use the built-in countries geometry, provide `locations` as [three-letter ISO country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). - ```python import plotly.express as px diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index 3f4553b3f7f..f4cbb961b05 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -51,7 +51,15 @@ Geo maps are outline-based maps. If your figure is created with a `px.scatter_ge ### Physical Base Maps -Plotly Geo maps have a built-in base map layer composed of "physical" and "cultural" (i.e. administrative border) data from the [Natural Earth Dataset](https://www.naturalearthdata.com/downloads/). Various lines and area fills can be shown or hidden, and their color and line-widths specified. In the [default `plotly` template](/python/templates/), a map frame and physical features such as a coastal outline and filled land areas are shown, at a small-scale 1:110m resolution: +Plotly Geo maps have a built-in base map layer composed of "physical" and "cultural" (i.e. administrative border) data. + +In **Plotly.py 6.3 and later**, the base map layer is created from the following sources: +- [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. +- Natural Earth data for oceans, lakes, rivers, and subunit layers. + +In **earlier versions of Plotly.py**, the base map layer is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). + +Various lines and area fills can be shown or hidden, and their color and line-widths specified. In the [default `plotly` template](/python/templates/), a map frame and physical features such as a coastal outline and filled land areas are shown, at a small-scale 1:110m resolution: ```python import plotly.graph_objects as go @@ -102,9 +110,9 @@ fig.show() In addition to physical base map features, a "cultural" base map is included which is composed of country borders and selected sub-country borders such as states. -**Note and disclaimer:** cultural features are by definition subject to change, debate and dispute. Plotly includes data from Natural Earth "as-is" and defers to the [Natural Earth policy regarding disputed borders](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/) which read: +In **Plotly.py 6.3 and later**, this base map is created from [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data). -> Natural Earth Vector draws boundaries of countries according to defacto status. We show who actually controls the situation on the ground. +In **earlier versions of Plotly.py**, this base map is based on Natural Earth data. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). **To create a map with your own cultural features** please refer to our [choropleth documentation](/python/choropleth-maps/). From 75af4407c1174024e35a27d2adbbee5c8c70cf5e Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Tue, 5 Aug 2025 15:14:07 -0400 Subject: [PATCH 09/17] fix wording --- doc/python/configuration-options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python/configuration-options.md b/doc/python/configuration-options.md index 81584acccd1..7e16dc4e623 100644 --- a/doc/python/configuration-options.md +++ b/doc/python/configuration-options.md @@ -327,7 +327,7 @@ fig.show(config=config) *New in 6.3* -Disabling the zoom in, zoom out, and autoscale buttons for specific axes is supported on cartesian axes using the `modebardisable` attribute. In the following example, the zoom in and zoom out buttons are disabled on the `xaxis`, meaning these buttons only zoom in and out on the `yaxis`. Disable the autoscale button using `modebardisable='autoscale'`. You can also disable both autoscaling and zoom buttons using `modebardisable='zoominout+autoscale'`. +Disabling the zoom in, zoom out, and autoscale buttons for specific axes is supported on cartesian axes using the `modebardisable` attribute. In the following example, the zoom in and zoom out buttons are disabled on the `xaxis`, meaning these buttons only zoom in and out on the `yaxis`. Disable the autoscale button using `modebardisable='autoscale'`. You can also disable the zoom and autoscale buttons using `modebardisable='zoominout+autoscale'`. ```python import plotly.graph_objects as go @@ -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 exampe. modebardisable='zoominout' ), yaxis=dict( From ce6ae1bb7d8839d476664403cab87f1969a9b0c8 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 12:34:55 -0400 Subject: [PATCH 10/17] Update doc/python/choropleth-maps.md Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com> --- doc/python/choropleth-maps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/choropleth-maps.md b/doc/python/choropleth-maps.md index c4ff93cfd0d..b18351080d2 100644 --- a/doc/python/choropleth-maps.md +++ b/doc/python/choropleth-maps.md @@ -214,7 +214,7 @@ In **Plotly.py 6.3 and later**, the built-in countries geometry is created from - [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. - Natural Earth data for oceans, lakes, rivers, and subunit layers. -In **earlier versions of Plotly.py**, the built-in countries geometry is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). +In **earlier versions of Plotly.py**, the built-in countries geometry is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to de facto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). To use the built-in countries geometry, provide `locations` as [three-letter ISO country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). From 377db50142431dbf9da348c481f929b4a63bc757 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 12:44:10 -0400 Subject: [PATCH 11/17] Update doc/python/map-configuration.md Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com> --- doc/python/map-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index f4cbb961b05..4e7a76ad4e0 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -112,7 +112,7 @@ In addition to physical base map features, a "cultural" base map is included whi In **Plotly.py 6.3 and later**, this base map is created from [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data). -In **earlier versions of Plotly.py**, this base map is based on Natural Earth data. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). +In **earlier versions of Plotly.py**, this base map is based on Natural Earth data. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to de facto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). **To create a map with your own cultural features** please refer to our [choropleth documentation](/python/choropleth-maps/). From cd57c4125109fcbac0b2bc99f60a65295fbffa56 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 12:44:42 -0400 Subject: [PATCH 12/17] Update doc/python/map-configuration.md Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com> --- doc/python/map-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index 4e7a76ad4e0..42d9239d0e3 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -51,7 +51,7 @@ Geo maps are outline-based maps. If your figure is created with a `px.scatter_ge ### Physical Base Maps -Plotly Geo maps have a built-in base map layer composed of "physical" and "cultural" (i.e. administrative border) data. +Plotly Geo maps have a built-in base map layer composed of *physical* and *cultural* (i.e. administrative border) data. In **Plotly.py 6.3 and later**, the base map layer is created from the following sources: - [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. From d4d9a3cc6a7dafd0b5d5b2e399d30148000ff8d4 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 12:44:57 -0400 Subject: [PATCH 13/17] Update doc/python/map-configuration.md Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com> --- doc/python/map-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index 42d9239d0e3..9e3218c2676 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -57,7 +57,7 @@ In **Plotly.py 6.3 and later**, the base map layer is created from the following - [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. - Natural Earth data for oceans, lakes, rivers, and subunit layers. -In **earlier versions of Plotly.py**, the base map layer is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). +In **earlier versions of Plotly.py**, the base map layer is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to de facto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). Various lines and area fills can be shown or hidden, and their color and line-widths specified. In the [default `plotly` template](/python/templates/), a map frame and physical features such as a coastal outline and filled land areas are shown, at a small-scale 1:110m resolution: From 16e454a9e3a73b0881dd4f72f121448870aa5902 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 13:00:59 -0400 Subject: [PATCH 14/17] Make small updates --- doc/python/log-plot.md | 14 +++++++------- doc/python/map-configuration.md | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/python/log-plot.md b/doc/python/log-plot.md index 42cefc8b07d..edce8eeb09b 100644 --- a/doc/python/log-plot.md +++ b/doc/python/log-plot.md @@ -84,7 +84,7 @@ fig.show() *New in 6.3* -By default, minor log labels use small digits, as shown in the previous example. You can control how minor log labels are displayed using the `minorloglabels` attribute. Set to `"complete"` to show complete digits, or `None` for no labels. +You can control how minor log labels are displayed using the `minorloglabels` attribute. Set to `"complete"` to show complete digits, or `None` for no labels. By default, minor log labels use `"small digits"`, as shown in the previous example. ```python import plotly.express as px @@ -92,18 +92,18 @@ import plotly.express as px df = px.data.gapminder().query("year == 2007") fig = px.scatter( - df, x="gdpPercap", - y="lifeExp", + df, x="gdpPercap", + y="lifeExp", hover_name="country", - log_x=True, - range_x=[1,100000], + log_x=True, + range_x=[1,100000], range_y=[0,100] ) fig.update_xaxes( minor=dict( - ticks="inside", - ticklen=6, + ticks="inside", + ticklen=6, showgrid=True ), minorloglabels="complete" diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index f4cbb961b05..6fa4f725397 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -110,9 +110,9 @@ fig.show() In addition to physical base map features, a "cultural" base map is included which is composed of country borders and selected sub-country borders such as states. -In **Plotly.py 6.3 and later**, this base map is created from [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data). +In **Plotly.py 6.3 and later**, this base map is created from [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, and Natural Earth data for sub-country borders. -In **earlier versions of Plotly.py**, this base map is based on Natural Earth data. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). +In **earlier versions of Plotly.py**, this base map is based only on Natural Earth data. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to defacto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). **To create a map with your own cultural features** please refer to our [choropleth documentation](/python/choropleth-maps/). From a03c3deef287f952e6ba646ad7f1a5a2ed66aed6 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 13:12:15 -0400 Subject: [PATCH 15/17] Update legend.md --- doc/python/legend.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/python/legend.md b/doc/python/legend.md index 04de7c25b73..6fc879fbc9c 100644 --- a/doc/python/legend.md +++ b/doc/python/legend.md @@ -258,7 +258,7 @@ fig.show() *New in 6.3* -By default, a legend can expand to fill up to half of the layout area height for a horizontal legend and the full height for a vertical legend. You can change this by specifying a `maxheight` for the legend. In the following plot with many legend items, we set `maxheight` to a ratio of 0.10, giving the plot more space. +By default, a legend can expand to fill up to half of the layout area height for a horizontal legend and the full height for a vertical legend. You can change this by specifying a `maxheight` for the legend. `maxheight` is interpreted as a ratio if it is 1 or less, and as an exact pixel value if it is greater than 1. In the following plot with many legend items, we set `maxheight` to a ratio of 0.10, giving the plot more space. ```python import plotly.express as px From c72d9a1c38e39a10e3c550629f8aec4e92211a8f Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 17:20:08 -0400 Subject: [PATCH 16/17] Update doc/python/map-configuration.md Co-authored-by: Cameron DeCoster --- doc/python/map-configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python/map-configuration.md b/doc/python/map-configuration.md index 5e7a22f4fe1..f7cee50282a 100644 --- a/doc/python/map-configuration.md +++ b/doc/python/map-configuration.md @@ -54,8 +54,8 @@ Geo maps are outline-based maps. If your figure is created with a `px.scatter_ge Plotly Geo maps have a built-in base map layer composed of *physical* and *cultural* (i.e. administrative border) data. In **Plotly.py 6.3 and later**, the base map layer is created from the following sources: -- [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. -- Natural Earth data for oceans, lakes, rivers, and subunit layers. +- [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, land, and oceans layers. +- Natural Earth data for lakes, rivers, and subunits layers. In **earlier versions of Plotly.py**, the base map layer is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to de facto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/). From 052efc91edfacb9052c386d2495abbc350efef90 Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 6 Aug 2025 17:20:18 -0400 Subject: [PATCH 17/17] Update doc/python/choropleth-maps.md Co-authored-by: Cameron DeCoster --- doc/python/choropleth-maps.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python/choropleth-maps.md b/doc/python/choropleth-maps.md index b18351080d2..7f9984478fc 100644 --- a/doc/python/choropleth-maps.md +++ b/doc/python/choropleth-maps.md @@ -211,8 +211,8 @@ Plotly comes with two built-in geometries which do not require an external GeoJS 2. Countries In **Plotly.py 6.3 and later**, the built-in countries geometry is created from the following sources: -- [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, and land layers. -- Natural Earth data for oceans, lakes, rivers, and subunit layers. +- [UN data](https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data) for country borders, coastlines, land, and ocean layers. +- Natural Earth data for lakes, rivers, and subunits layers. In **earlier versions of Plotly.py**, the built-in countries geometry is based on Natural Earth data only. Plotly includes data from Natural Earth "as-is". This dataset draws boundaries of countries according to de facto status. See the [Natural Earth page for more details](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/).