8000 DOC: Add correct headings to sankey. · matplotlib/matplotlib@a455b01 · GitHub
[go: up one dir, main page]

Skip to content

Commit a455b01

Browse files
committed
DOC: Add correct headings to sankey.
1 parent 0ecd097 commit a455b01

File tree

1 file changed

+54
-51
lines changed

1 file changed

+54
-51
lines changed

lib/matplotlib/sankey.py

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -45,50 +45,9 @@ def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,
4545
"""
4646
Create a new Sankey instance.
4747
48-
Optional keyword arguments:
49-
50-
=============== ===================================================
51-
Field Description
52-
=============== ===================================================
53-
*ax* axes onto which the data should be plotted
54-
If *ax* isn't provided, new axes will be created.
55-
*scale* scaling factor for the flows
56-
*scale* sizes the width of the paths in order to
57-
maintain proper layout. The same scale is applied
58-
to all subdiagrams. The value should be chosen
59-
such that the product of the scale and the sum of
60-
the inputs is approximately 1.0 (and the product of
61-
the scale and the sum of the outputs is
62-
approximately -1.0).
63-
*unit* string representing the physical unit associated
64-
with the flow quantities
65-
If *unit* is None, then none of the quantities are
66-
labeled.
67-
*format* a Python number formatting string to be used in
68-
labeling the flow as a quantity (i.e., a number
69-
times a unit, where the unit is given)
70-
*gap* space between paths that break in/break away
71-
to/from the top or bottom
72-
*radius* inner radius of the vertical paths
73-
*shoulder* size of the shoulders of output arrowS
74-
*offset* text offset (from the dip or tip of the arrow)
75-
*head_angle* angle of the arrow heads (and negative of the angle
76-
of the tails) [deg]
77-
*margin* minimum space between Sankey outlines and the edge
78-
of the plot area
79-
*tolerance* acceptable maximum of the magnitude of the sum of
80-
flows
81-
The magnitude of the sum of connected flows cannot
82-
be greater than *tolerance*.
83-
=============== ===================================================
84-
85-
The optional arguments listed above are applied to all subdiagrams so
48+
The optional arguments listed below are applied to all subdiagrams so
8649
that there is consistent alignment and formatting.
8750
88-
If :class:`Sankey` is instantiated with any keyword arguments other
89-
than those explicitly listed above (``**kwargs``), they will be passed
90-
to :meth:`add`, which will create the first subdiagram.
91-
9251
In order to draw a complex Sankey diagram, create an instance of
9352
:class:`Sankey` by calling it without any kwargs::
9453
@@ -109,6 +68,48 @@ def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,
10968
11069
Sankey().add().add... .add().finish()
11170
71+
Other Parameters
72+
----------------
73+
ax : `~.axes.Axes`
74+
Axes onto which the data should be plotted. If *ax* isn't
75+
provided, new Axes will be created.
76+
scale : float
77+
Scaling factor for the flows. *scale* sizes the width of the paths
78+
in order to maintain proper layout. The same scale is applied to
79+
all subdiagrams. The value should be chosen such that the product
80+
of the scale and the sum of the inputs is approximately 1.0 (and
81+
the product of the scale and the sum of the outputs is
82+
approximately -1.0).
83+
unit : str
84+
The physical unit associated with the flow quantities. If *unit*
85+
is None, then none of the quantities are labeled.
86+
format : str
87+
A Python number formatting string to be used in labeling the flow
88+
as a quantity (i.e., a number times a unit, where the unit is
89+
given).
90+
gap : float
91+
Space between paths that break in/break away to/from the top or
92+
bottom.
93+
radius : float
94+
Inner radius of the vertical paths.
95+
shoulder : float
96+
Size of the shoulders of output arrows.
97+
offset : float
98+
Text offset (from the dip or tip of the arrow).
99+
head_angle : float
100+
Angle, in degrees, of the arrow heads (and negative of the angle of
101+
the tails).
102+
margin : float
103+
Minimum space between Sankey outlines and the edge of the plot
104+
area.
105+
tolerance : float
106+
Acceptable maximum of the magnitude of the sum of flows. The
107+
magnitude of the sum of connected flows cannot be greater than
108+
*tolerance*.
109+
**kwargs
110+
Any additional keyword arguments will be passed to :meth:`add`,
111+
which will create the first subdiagram.
112+
112113
See Also
113114
--------
114115
Sankey.add
@@ -168,15 +169,17 @@ def _arc(self, quadrant=0, cw=True, radius=1, center=(0, 0)):
168169
Return the codes and vertices for a rotated, scaled, and translated
169170
90 degree arc.
170171
171-
Optional keyword arguments:
172-
173-
=============== ==========================================
174-
Keyword Description
175-
=============== ==========================================
176-
*quadrant* uses 0-based indexing (0, 1, 2, or 3)
177-
*cw* if True, clockwise
178-
*center* (x, y) tuple of the arc's center
179-
=============== ==========================================
172+
Other Parameters
173+
----------------
174+
quadrant : {0, 1, 2, 3}, default: 0
175+
Uses 0-based indexing (0, 1, 2, or 3).
176+
cw : bool, default: True
177+
If True, the arc vertices are produced clockwise; counter-clockwise
178+
otherwise.
179+
radius : float, default: 1
180+
The radius of the arc.
181+
center : (float, float), default: (0, 0)
182+
(x, y) tuple of the arc's center.
180183
"""
181184
# Note: It would be possible to use matplotlib's transforms to rotate,
182185
# scale, and translate the arc, but since the angles are discrete,

0 commit comments

Comments
 (0)
0