Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased


## [6.8.0] - 2026-06-03

### Added
- Add optional `font` parameter for `make_subplots` [[#5393](https://github.com/plotly/plotly.py/pull/5393)]
- Add optional `font` parameter for `make_subplots` [[#5393](https://github.com/plotly/plotly.py/pull/5393)], with thanks to @Zomtir for the contribution!

### Fixed
- Fix issue where user-specified `color_continuous_scale` was ignored when template had `autocolorscale=True` [[#5439](https://github.com/plotly/plotly.py/pull/5439)], with thanks to @antonymilne for the contribution!
- Use presence of `COLAB_NOTEBOOK_ID` env var to enable Colab renderer instead of testing import of `google.colab` [[#5473](https://github.com/plotly/plotly.py/pull/5473)], with thanks to @kevineger for the contribution!
- Fix incorrect annotation placement for `add_vline`, `add_hline`, `add_vrect`, and `add_hrect` on datetime axes [[#5508](https://github.com/plotly/plotly.py/pull/5508)], with thanks to @mosh3eb for the contribution!
- Update tests to be compatible with numpy 2.4 [[#5522](https://github.com/plotly/plotly.py/pull/5522)], with thanks to @thunze for the contribution!
- Add default headers to be passed in to Kaleido v1.3.0 to avoid blocked Open Street Map tiles [#5588](https://github.com/plotly/plotly.py/pull/5588)]
- Fix issue where `js/` directory was unintentionally installed as a top-level Python package when installing `plotly` [[#5587](https://github.com/plotly/plotly.py/pull/5587)]
- Add default headers to be passed in to Kaleido v1.3.0 to avoid blocked Open Street Map tiles [[#5588](https://github.com/plotly/plotly.py/pull/5588)]
- Propagate the requested `default_height`/`default_width` to the outer wrapper div produced by `to_html` so that responsive (percentage) dimensions inherit from a sized parent container instead of collapsing to the plotly.js 450px fallback [[#5591](https://github.com/plotly/plotly.py/issues/5591)], with thanks to @SharadhNaidu for the contribution!

### Updated
- The `__eq__` method for `graph_objects` classes now returns `NotImplemented` to give the other operand an opportunity to handle the comparison [[#5547](https://github.com/plotly/plotly.py/pull/5547)], with thanks to @RazerM for the contribution!
- Update plotly.js from version 3.5.0 to version 3.6.0. See the plotly.js [release notes](https://github.com/plotly/plotly.js/releases/tag/v3.6.0) for more information [[#5608](https://github.com/plotly/plotly.py/pull/5608)]. Notable changes include:
- Add support for arrays for the pie property `legendrank`, so that it can be configured per slice [[#7723](https://github.com/plotly/plotly.js/pull/7723)]
- Add `hoversort` layout attribute to sort unified hover label items by value [[#7734](https://github.com/plotly/plotly.js/pull/7734)]

## [6.7.0] - 2026-04-09

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors:
- family-names: "Parmer"
given-names: "Chris"
title: "An interactive, open-source, and browser-based graphing library for Python"
version: 6.7.0
version: 6.8.0
doi: 10.5281/zenodo.14503524
date-released: 2026-04-09
date-released: 2026-06-03
url: "https://github.com/plotly/plotly.py"
26 changes: 25 additions & 1 deletion doc/python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ fig.update_layout(hovermode="x unified")
fig.show()
```

#### Sorting Unified Hover Labels by Value

*New in 6.8*

In `'x unified'` and `'y unified'` hover modes, items in the hover label appear in the order their traces were added to the figure (the default, `hoversort="trace"`). Set `layout.hoversort` to `"value descending"` or `"value ascending"` to instead sort the items by the value being shown, which makes it easier to compare traces at a glance.

```python
import plotly.express as px

df = px.data.stocks()

fig = px.line(df, x="date", y=df.columns[1:], title="layout.hoversort='value descending'")
fig.update_traces(hovertemplate=None)
fig.update_layout(hovermode="x unified", hoversort="value descending")

fig.show()
```

#### Customize Title in Unified Hover Mode

*New in 6.3*
Expand Down Expand Up @@ -221,7 +239,13 @@ fig.update_layout(
fig.show()
```

### Customizing Hover text with Plotly Express
### Emitting Hover and Click Events Anywhere in the Plot Area

*New in 6.7*

By default, hover and click events are only emitted when the cursor is over a trace. Set `hoveranywhere` or `clickanywhere` to `True` to emit these events anywhere inside the plot area, including over empty space: `fig.update_layout(hoveranywhere=True, clickanywhere=True)`. The events carry the cursor's data coordinates, which is useful when building interactive callbacks (for example, in [Dash](https://dash.plotly.com/)) that need to respond to clicks on locations that don't correspond to a specific data point.

### Customizing Hover Text with Plotly Express

Plotly Express functions automatically add all the data being plotted (x, y, color etc) to the hover label. Many Plotly Express functions also support configurable hover text. The `hover_data` argument accepts a list of column names to be added to the hover tooltip, or a dictionary for advanced formatting (see the next section). The `hover_name` property controls which column is displayed in bold as the tooltip title.

Expand Down
19 changes: 19 additions & 0 deletions doc/python/legend.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ fig.add_shape(
fig.show()
```

##### Per-Slice `legendrank` for Pie Traces

*New in 6.8*

For `pie` traces, `legendrank` also accepts an array so that each slice can be ranked individually. In the example below, the slices appear in the legend in the order specified by `legendrank` (lowest rank first), independent of the order of `values`.

```python
import plotly.graph_objects as go

fig = go.Figure(
go.Pie(
labels=["Oxygen", "Hydrogen", "Carbon", "Nitrogen", "Other"],
values=[4500, 2500, 1053, 500, 600],
legendrank=[3, 1, 2, 5, 4],
)
)
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.
Expand Down
2 changes: 2 additions & 0 deletions doc/python/static-image-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ The following settings are available.

`topojson`: Location of the topojson files needed to render choropleth traces. Defaults to a CDN location. If fully offline export is required, set this to a local directory containing the Plotly.js topojson files.

`headers`: *New in 6.8.* A dict of HTTP headers Kaleido sends when fetching external resources during image export (for example, when fetching OpenStreetMap tiles for tile maps). Defaults to `{"X-Requested-With": "plotly.py"}`, which is required to comply with the [OpenStreetMap tile usage policy](https://operations.osmfoundation.org/policies/tiles/). Requires Kaleido v1.3.0 or later.

`mapbox_access_token`: The default Mapbox access token (Kaleido v0 only). Mapbox traces are deprecated. See the [MapLibre Migration](https://plotly.com/python/mapbox-to-maplibre/) page for more details.

### Set Defaults
Expand Down
22 changes: 22 additions & 0 deletions doc/python/subplots.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,28 @@ fig.update_layout(height=500, width=700,
fig.show()
```

#### Customizing the Subplot Title Font

*New in 6.8*

Use the `font` argument of `make_subplots` to customize the font used for `subplot_titles`, `column_titles`, `row_titles`, `x_title`, and `y_title`. The argument accepts a dict with any of the standard [font attributes](https://plotly.com/python/reference/layout/annotations/#layout-annotations-items-annotation-font) (`family`, `size`, `color`, `weight`, etc.).

```python
from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(
rows=1, cols=2,
subplot_titles=("Plot 1", "Plot 2"),
font=dict(family="Courier New, monospace", size=20, color="RebeccaPurple"),
)

fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]), row=1, col=1)
fig.add_trace(go.Scatter(x=[20, 30, 40], y=[50, 60, 70]), row=1, col=2)

fig.show()
```

#### Subplots with Annotations

```python
Expand Down
4 changes: 2 additions & 2 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jupyterlab-plotly",
"main": "lib/mimeExtension.js",
"version": "6.7.0",
"version": "6.8.0",
"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.py"
Expand Down
6 changes: 3 additions & 3 deletions plotly/labextension/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jupyterlab-plotly",
"main": "lib/mimeExtension.js",
"version": "6.7.0",
"version": "6.8.0",
"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.py"
Expand All @@ -19,7 +19,7 @@
},
"dependencies": {
"lodash-es": "^4.17.21",
"plotly.js": "3.5.0",
"plotly.js": "3.6.0",
"@lumino/widgets": "~2.4.0"
},
"devDependencies": {
Expand All @@ -33,7 +33,7 @@
"outputDir": "../plotly/labextension",
"webpackConfig": "./webpack.config.js",
"_build": {
"load": "static/remoteEntry.b2077f01f9b03ba2c63d.js",
"load": "static/remoteEntry.2a6392a40c19ad8383a0.js",
"mimeExtension": "./mimeExtension"
}
}
Expand Down
2 changes: 2 additions & 0 deletions plotly/labextension/static/1.747c8e0c8042a68fba0a.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions plotly/labextension/static/1.9daa5160b7fc741623bf.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
requires-python = ">=3.8"
license = "MIT"
license-files = ["LICENSE.txt"]
version = "6.7.0"
version = "6.8.0"
dependencies = [
"narwhals>=1.15.1",
"packaging"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.