Skip to content

Commit 146049e

Browse files
Copilotxadupre
andauthored
docs: add usage example to graph_sankey docstring
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/cd5e1831-153c-45c1-a63e-d8624958ffd7 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
1 parent 1d8f17a commit 146049e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

teachpyx/faq/faq_python.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,19 @@ def graph_sankey(
868868
:param kwargs: additional parameters forwarded to
869869
``matplotlib.sankey.Sankey.add``
870870
:return: axis, sankey diagrams
871+
872+
Example::
873+
874+
import matplotlib.pyplot as plt
875+
from teachpyx.faq.faq_python import graph_sankey
876+
877+
ax, _ = graph_sankey(
878+
[1, -0.25, -0.75],
879+
labels=["input", "loss", "output"],
880+
orientations=[0, 1, -1],
881+
title="flux",
882+
)
883+
plt.show()
871884
"""
872885
if len(flows) < 2:
873886
raise ValueError(f"flows must contain at least two values, got {len(flows)}.")

0 commit comments

Comments
 (0)