Skip to content

Commit e8e40ee

Browse files
benjefferyjeromekelleher
authored andcommitted
Add metadata example to node label docs
1 parent 2210361 commit e8e40ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/tskit/trees.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,8 @@ def draw_svg(
18891889
0.3.6)
18901890
:param node_labels: If specified, show custom labels for the nodes
18911891
(specified by ID) that are present in this map; any nodes not present will
1892-
not have a label.
1892+
not have a label. To use a metadata key, for example, use
1893+
``node_labels={node.id: node.metadata["key"] for node in ts.nodes()}``.
18931894
:type node_labels: dict(int, str)
18941895
:param mutation_labels: If specified, show custom labels for the
18951896
mutations (specified by ID) that are present in the map; any mutations

0 commit comments

Comments
 (0)