Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b68c2cd
added a cross reference
rl-utility-man Aug 23, 2025
5be7c20
Made the spelling of hover mode and hover template consistent with ho…
rl-utility-man Feb 9, 2026
7df8306
Update config.yml
LiamConnors Feb 16, 2026
19454c5
Update requirements.txt
LiamConnors Feb 16, 2026
6391e6e
Revert "Update config.yml"
LiamConnors Feb 16, 2026
9037f2d
Update doc/requirements.txt
LiamConnors Feb 17, 2026
3b2bbec
Merge pull request #5511 from plotly/fix-build-docs
LiamConnors Feb 17, 2026
ee788bf
Merge branch 'doc-prod' into patch-21
LiamConnors Feb 17, 2026
e204d00
Merge pull request #5498 from rl-utility-man/patch-21
LiamConnors Feb 19, 2026
6e7bf27
Update 2D-Histogram.md
LiamConnors Feb 27, 2026
078db0f
Update 2d-histogram-contour.md
LiamConnors Feb 27, 2026
65e3b13
Merge pull request #5526 from plotly/check-pages
LiamConnors Mar 2, 2026
70f9b68
Merge branch 'doc-prod' into make-docs-live-6-6-0
LiamConnors Mar 3, 2026
e13d38d
Merge branch 'main' into make-docs-live-6-6-0
LiamConnors Mar 3, 2026
4cfec3d
Merge pull request #5530 from plotly/make-docs-live-6-6-0
LiamConnors Mar 3, 2026
4680f04
Update location-mode.md
LiamConnors Apr 3, 2026
fcb8a84
add notifications example
LiamConnors Apr 3, 2026
97f4030
add note on locations as full state names
LiamConnors Apr 3, 2026
dbe34ad
update config example
LiamConnors Apr 3, 2026
09aa8ba
show how to make the output in the Jinja2 example responsive
rl-utility-man May 6, 2026
feec1e0
split into two simpler Python examples
rl-utility-man May 8, 2026
a071788
Update docs build to use plotly.py 6.7.0
camdecoster May 11, 2026
4ddd717
Update doc/python/interactive-html-export.md
rl-utility-man May 11, 2026
df8c013
Update docs to include facet_row
camdecoster May 11, 2026
70b692c
Apply suggestions from code review
rl-utility-man May 12, 2026
de4bc73
Merge remote-tracking branch 'origin/main' into docs-for-next-release
camdecoster May 12, 2026
7aecf1c
switch to a standard reference link
rl-utility-man May 12, 2026
7dc4ed8
Update reference section
camdecoster May 12, 2026
e4d7b77
Merge pull request #5590 from rl-utility-man/patch-22
camdecoster May 12, 2026
cda23ca
Merge remote-tracking branch 'origin/doc-prod' into docs-for-next-rel…
camdecoster May 12, 2026
cdb6822
Update language
camdecoster May 12, 2026
d5ac1bd
Merge pull request #5333 from rl-utility-man/patch-20
camdecoster May 12, 2026
5511264
Merge remote-tracking branch 'origin/doc-prod' into docs-for-next-rel…
camdecoster May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/python/2D-Histogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jupyter:
page_type: u-guide
permalink: python/2D-Histogram/
redirect_from:
- python/2d-histogram/
- python/2d-histograms/
thumbnail: thumbnail/histogram2d.jpg
---
Expand Down
2 changes: 1 addition & 1 deletion doc/python/2d-histogram-contour.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jupyter:

## 2D Histogram Contours or Density Contours

A 2D histogram contour plot, also known as a density contour plot, is a 2-dimensional generalization of a [histogram](/python/histograms/) which resembles a [contour plot](/python/contour-plots/) but is computed by grouping a set of points specified by their `x` and `y` coordinates into bins, and applying an aggregation function such as `count` or `sum` (if `z` is provided) to compute the value to be used to compute contours. This kind of visualization (and the related [2D histogram, or density heatmap](/python/2d-histogram/)) is often used to manage over-plotting, or situations where showing large data sets as [scatter plots](/python/line-and-scatter/) would result in points overlapping each other and hiding patterns.
A 2D histogram contour plot, also known as a density contour plot, is a 2-dimensional generalization of a [histogram](/python/histograms/) which resembles a [contour plot](/python/contour-plots/) but is computed by grouping a set of points specified by their `x` and `y` coordinates into bins, and applying an aggregation function such as `count` or `sum` (if `z` is provided) to compute the value to be used to compute contours. This kind of visualization (and the related [2D histogram, or density heatmap](/python/2D-Histogram/)) is often used to manage over-plotting, or situations where showing large data sets as [scatter plots](/python/line-and-scatter/) would result in points overlapping each other and hiding patterns.

## Density Contours with Plotly Express

Expand Down
2 changes: 1 addition & 1 deletion doc/python/choropleth-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ fig = px.choropleth(df, locations="iso_alpha",
fig.show()
```

To use the USA States geometry, set `locationmode='USA-states'` and provide `locations` as [two-letter state abbreviations](/python/outline-map-locations/#supported-us-state-codes):
To use the USA States geometry, set `locationmode='USA-states'` and provide `locations` as [two-letter state abbreviations](/python/outline-map-locations/#supported-us-state-codes) or [full state names](/python/outline-map-locations/#locationmode='USA-states'):

```python
import plotly.express as px
Expand Down
2 changes: 1 addition & 1 deletion doc/python/colorscales.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fig.show()

### Explicitly Constructing a Color scale

The Plotly Express `color_continuous_scale` argument accepts explicitly-constructed color scales as well:
The Plotly Express `color_continuous_scale` argument accepts explicitly-constructed color scales as well. There is an equivalent graph objects example using the `colorscale` parameter [below](#custom-heatmap-color-scale-with-graph-objects).

```python
import plotly.express as px
Expand Down
20 changes: 18 additions & 2 deletions doc/python/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.17.2
jupytext_version: 1.16.4
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.12.4
version: 3.9.19
plotly:
description: How to set the configuration options of figures using the Plotly
Python graphing library.
Expand Down Expand Up @@ -359,6 +359,22 @@ fig = go.Figure(
fig.show()
```

### Hiding Notifications

*New in 6.7*

Plotly displays a notification in the top-right corner of the plot when downloading the plot as an image, when first clicking a legend item, and when zooming in. Set `displayNotifier` to `False` to hide these notifications.

```python
import plotly.express as px

df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species")

config = {"displayNotifier": True}
fig.show(config=config)
```

### 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).
Expand Down
48 changes: 24 additions & 24 deletions doc/python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ One of the most deceptively-powerful features of interactive visualization using

There are three hover modes available in Plotly. The default setting is `layout.hovermode='closest'`, wherein a single hover label appears for the point directly underneath the cursor.

#### Hovermode `closest` (default mode)
#### Hover mode `closest` (default mode)

```python
import plotly.express as px
Expand All @@ -51,7 +51,7 @@ fig.update_traces(mode="markers+lines")
fig.show()
```

#### Hovermode `x` or `y`
#### Hover mode `x` or `y`

If `layout.hovermode='x'` (or `'y'`), a single hover label appears per trace, for points at the same `x` (or `y`) value as the cursor. If multiple points in a given trace exist at the same coordinate, only one will get a hover label. In the line plot below we have forced markers to appear, to make it clearer what can be hovered over, and we have disabled the built-in Plotly Express `hovertemplate` by setting it to `None`, resulting in a more compact hover label per point:

Expand All @@ -67,7 +67,7 @@ fig.update_layout(hovermode="x")
fig.show()
```

#### Unified hovermode
#### Unified hover mode

If `layout.hovermode='x unified'` (or `'y unified'`), a single hover label appear, describing one point per trace, for points at the same `x` (or `y`) value as the cursor. If multiple points in a given trace exist at the same coordinate, only one will get an entry in the hover label. In the line plot below we have forced markers to appear, to make it clearer what can be hovered over, and we have disabled the built-in Plotly Express `hovertemplate` by setting it to `None`, resulting in a more compact entry per point in the hover label:

Expand All @@ -83,11 +83,11 @@ fig.update_layout(hovermode="x unified")
fig.show()
```

#### Customize Title in Unified Hovermode
#### Customize Title in Unified Hover Mode

*New in 6.3*

Customize the title shown in unified hovermode, by specifing `unifiedhovertitle.text`.
Customize the title shown in unified hover mode, 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}\"`.

Expand Down Expand Up @@ -134,13 +134,13 @@ fig.show()

```

#### Control hovermode with Dash
#### Control Hover Mode 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`.

Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**

Change the hovermode below and try hovering over the points:
Change the hover mode below and try hovering over the points:

```python hide_code=true
from IPython.display import IFrame
Expand All @@ -152,9 +152,9 @@ IFrame(snippet_url + 'hover-text-and-formatting', width='100%', height=1200)
<u><a href="https://go.plotly.com/dash-club?utm_source=Dash+Club+2022&utm_medium=graphing_libraries&utm_content=inline">Join now</a></u>.</p></div></div></div></div>


#### Selecting a hovermode in a figure created with `plotly.graph_objects`
#### Selecting a hover mode in a figure created with `plotly.graph_objects`

The hovermode is a property of the figure layout, so you can select a hovermode no matter how you created the figure, either with `plotly.express` or with `plotly.graph_objects`. Below is an example with a figure created with `plotly.graph_objects`. If you're not familiar with the structure of plotly figures, you can read [the tutorial on creating and updating plotly figures](/python/creating-and-updating-figures/).
The hover mode is a property of the figure layout, so you can select a hover mode no matter how you created the figure, either with `plotly.express` or with `plotly.graph_objects`. Below is an example with a figure created with `plotly.graph_objects`. If you're not familiar with the structure of plotly figures, you can read [the tutorial on creating and updating plotly figures](/python/creating-and-updating-figures/).

```python
import plotly.graph_objects as go
Expand Down Expand Up @@ -267,12 +267,12 @@ fig.update_layout(height=300)
fig.show()
```

### Customizing hover text with a hovertemplate
### Customizing hover text with a hover template

To customize the tooltip on your graph you can use the [hovertemplate](https://plotly.com/python/reference/pie/#pie-hovertemplate) attribute of `graph_objects` traces, which is a template string used for rendering the information that appear on hoverbox.
This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-time-format). In the example below, the empty `<extra></extra>` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. The `<extra>` tag can be used to display other parts of the hovertemplate, it is not reserved for the trace name.
This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-time-format). In the example below, the empty `<extra></extra>` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. The `<extra>` tag can be used to display other parts of the hover template, it is not reserved for the trace name.

Note that a hovertemplate customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/pie/#pie-texttemplate) customizes the text that appears on your chart. <br>
Note that a hover template customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/pie/#pie-texttemplate) customizes the text that appears on your chart. <br>

Set the horizontal alignment of the text within tooltip with [hoverlabel.align](https://plotly.com/python/reference/layout/#layout-hoverlabel-align).

Expand All @@ -297,7 +297,7 @@ fig.add_trace(go.Scatter(

fig.update_layout(
hoverlabel_align = 'right',
title = "Set hover text with hovertemplate")
title = "Set hover text with hover template")

fig.show()
```
Expand All @@ -316,9 +316,9 @@ fig = go.Figure(go.Pie(
fig.show()
```

### Modifying the hovertemplate of a plotly express figure
### Modifying the hover template of a plotly express figure

`plotly.express` automatically sets the hovertemplate but you can modify it using the `update_traces` method of the generated figure. It helps to print the hovertemplate generated by `plotly.express` in order to be able to modify it. One can also revert to the default hover information of traces by setting the hovertemplate to `None`.
`plotly.express` automatically sets the hover template but you can modify it using the `update_traces` method of the generated figure. It helps to print the hover template generated by `plotly.express` in order to be able to modify it. One can also revert to the default hover information of traces by setting the hover template to `None`.

```python
import plotly.express as px
Expand All @@ -327,14 +327,14 @@ df_2007 = px.data.gapminder().query("year==2007")

fig = px.scatter(df_2007, x="gdpPercap", y="lifeExp", log_x=True, color='continent'
)
print("plotly express hovertemplate:", fig.data[0].hovertemplate)
print("plotly express hover template:", fig.data[0].hovertemplate)
fig.update_traces(hovertemplate='GDP: %{x} <br>Life Expectancy: %{y}') #
fig.update_traces(hovertemplate=None, selector={'name':'Europe'}) # revert to default hover
print("user_defined hovertemplate:", fig.data[0].hovertemplate)
print("user defined hover template:", fig.data[0].hovertemplate)
fig.show()
```

### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate
### Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hover template

This example adds custom fields to a Plotly Express figure using the `custom_data` parameter and then adds a hover template that applies d3 formats to each element of the `customdata[n]` array and uses HTML to customize the fonts and spacing.

Expand All @@ -357,13 +357,13 @@ fig=px.scatter(df,
y='Life Expectancy (years)',
color='continent',
size=np.sqrt(df['pop']),
# Specifying data to make available to the hovertemplate
# Specifying data to make available to the hover template
# The px custom_data parameter has an underscore, while the analogous graph objects customdata parameter has no underscore.
# The px custom_data parameter is a list of column names in the data frame, while the graph objects customdata parameter expects a data frame or a numpy array.
custom_data=['country', 'continent', 'pop'],
)

# Plotly express does not have a hovertemplate parameter in the graph creation function, so we apply the template with update_traces
# Plotly express does not have a hover template parameter in the graph creation function, so we apply the template with update_traces
fig.update_traces(
hovertemplate =
"<b>%{customdata[0]}</b><br>" +
Expand All @@ -390,7 +390,7 @@ fig.show()

*New in v5.0*

When [displaying periodic data](https://plotly.com/python/time-series/#displaying-period-data) with mixed-sized periods (i.e. quarterly and monthly) in conjunction with `x` or `x unified` hovermodes and using `hovertemplate`, the `xhoverformat` attribute can be used to control how each period's X value is displayed, and the special `%{xother}` hover-template directive can be used to control how the X value is displayed for points that do not share the exact X coordinate with the point that is being hovered on. `%{xother}` will return an empty string when the X value is the one being hovered on, otherwise it will return `(%{x})`. The special `%{_xother}`, `%{xother_}` and `%{_xother_}` variations will display with spaces before, after or around the parentheses, respectively.
When [displaying periodic data](https://plotly.com/python/time-series/#displaying-period-data) with mixed-sized periods (i.e. quarterly and monthly) in conjunction with `x` or `x unified` hover modes and using `hovertemplate`, the `xhoverformat` attribute can be used to control how each period's X value is displayed, and the special `%{xother}` hover-template directive can be used to control how the X value is displayed for points that do not share the exact X coordinate with the point that is being hovered on. `%{xother}` will return an empty string when the X value is the one being hovered on, otherwise it will return `(%{x})`. The special `%{_xother}`, `%{xother_}` and `%{_xother_}` variations will display with spaces before, after or around the parentheses, respectively.

```python
import plotly.graph_objects as go
Expand Down Expand Up @@ -422,7 +422,7 @@ fig.show()

### Advanced Hover Template

This produces the same graphic as in "Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hovertemplate" above, but does so with the `customdata` and `text` parameters of `graph_objects`. It shows how to specify columns from a dataframe to include in the `customdata` array using the `df[["col_i", "col_j"]]` subsetting notation. It then references those variables using e.g. `%{customdata[0]}` in the hovertemplate. It includes comments about major differences between the parameters used by `graph_objects` and `plotly.express`.
This produces the same graphic as in "Specifying the formatting and labeling of custom fields in a Plotly Express figure using a hover template" above, but does so with the `customdata` and `text` parameters of `graph_objects`. It shows how to specify columns from a dataframe to include in the `customdata` array using the `df[["col_i", "col_j"]]` subsetting notation. It then references those variables using e.g. `%{customdata[0]}` in the hover template. It includes comments about major differences between the parameters used by `graph_objects` and `plotly.express`.

```python
import plotly.graph_objects as go
Expand Down Expand Up @@ -458,7 +458,7 @@ for continent_name, df in continent_data.items():
# The next three parameters specify the hover text
# Text supports just one customized field per trace
# and is implemented here with text=df['continent'],
# Custom data supports multiple fields through numeric indices in the hovertemplate
# Custom data supports multiple fields through numeric indices in the hover template
# In we weren't using the text parameter in our example,
# we could instead add continent as a third customdata field.
customdata=df[['country','pop']],
Expand Down Expand Up @@ -486,7 +486,7 @@ fig.update_layout(
fig.show()
```

### Adding other data to the hover with customdata and a hovertemplate
### Adding other data to the hover with customdata and a hover template

`go` traces have a `customdata` argument in which you can add an array, which outer dimensions should have the same dimensions as the plotted data. You can then use `customdata` inside a `hovertemplate` to display the value of customdata.

Expand Down
Loading
Loading