8000 Update plotly js to 2.30.0 by LiamConnors · Pull Request #4542 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Update plotly js to 2.30.0 #4542

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add legend indentation example
  • Loading branch information
LiamConnors committed Mar 11, 2024
commit 131fe09dd9b3fba9f6d04e6455733ef12a22ef8c
43 changes: 41 additions & 2 deletions doc/python/legend.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.14.7
jupytext_version: 1.16.1
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.10.4
version: 3.10.11
plotly:
description: How to configure and style the legend in Plotly with Python.
display_as: file_settings
Expand Down Expand Up @@ -546,6 +546,45 @@ fig.update_layout(title="Try Clicking on the Legend Items!")
fig.show()
```

```python
df = data.iris()
df
```

#### Indent Legend Entries

*New in 5.20*

To indent legend entries, set `indenation` on `layout.legend` to a number of pixels. In the following example, we indent legend entries by 10 pixels.

```python
import plotly.graph_objects as go
from plotly import data

df = data.iris()

fig = go.Figure(
[
go.Scatter(
x=df[df["species"] == species]["sepal_width"],
y=df[df["species"] == species]["sepal_length"],
mode="markers",
name=species,
)
for species in df["species"].unique()
],
layout=dict(
legend=dict(
title="Species",
indentation=10
)
),
)


fig.show()
```

#### Group click toggle behavior

*New in v5.3*
Expand Down
0