Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d37b027

Browse files
committed
Fix the orientations kwarg in sankey.add
1 parent 4b9f77d commit d37b027

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/sankey.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def _revert(self, path, first_action=Path.LINETO):
245245
#return path
246246

247247
@docstring.dedent_interpd
248-
def add(self, patchlabel='', flows=None, orientations=[0, 0], labels='',
248+
def add(self, patchlabel='', flows=None, orientations=None, labels='',
249249
trunklength=1.0, pathlengths=0.25, prior=None, connect=(0, 0),
250250
rotation=0, **kwargs):
251251
"""
@@ -338,6 +338,8 @@ def add(self, patchlabel='', flows=None, orientations=[0, 0], labels='',
338338
else:
339339
# In the code below, angles are expressed in deg/90
340340
rotation /= 90.0
341+
if orientations is None:
342+
orientations = [0, 0]
341343
assert len(orientations) == n, (
342344
"orientations and flows must have the same length.\n"
343345
"orientations has length %d, but flows has length %d."

0 commit comments

Comments
 (0)