Skip to content

Commit 92116d5

Browse files
docs for legendgrouptitle
1 parent d0342aa commit 92116d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/python/legend.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ fig.show()
346346

347347
#### Grouped Legend Items
348348

349-
Grouping legend items together by setting the `legendgroup` attribute of traces causes their legend entries to be next to each other, and clicking on any legend entry in the group will show or hide the whole group.
349+
Grouping legend items together by setting the `legendgroup` attribute of traces causes their legend entries to be next to each other, and clicking on any legend entry in the group will show or hide the whole group. The `legendgrouptitle` attribute can be used to give titles to groups.
350350

351351
```python
352352
import plotly.graph_objects as go
@@ -357,6 +357,7 @@ fig.add_trace(go.Scatter(
357357
x=[1, 2, 3],
358358
y=[2, 1, 3],
359359
legendgroup="group", # this can be any string, not just "group"
360+
legendgrouptitle_text="First Group Title",
360361
name="first legend group",
361362
mode="markers",
362363
marker=dict(color="Crimson", size=10)
@@ -375,6 +376,7 @@ fig.add_trace(go.Scatter(
375376
x=[1, 2, 3],
376377
y=[4, 9, 2],
377378
legendgroup="group2",
379+
legendgrouptitle_text="Second Group Title",
378380
name="second legend group",
379381
mode="markers",
380382
marker=dict(color="MediumPurple", size=10)

0 commit comments

Comments
 (0)