Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cf846d commit 4b9f77dCopy full SHA for 4b9f77d
lib/matplotlib/sankey.py
@@ -245,9 +245,9 @@ def _revert(self, path, first_action=Path.LINETO):
245
#return path
246
247
@docstring.dedent_interpd
248
- def add(self, patchlabel='', flows=np.array([1.0, -1.0]),
249
- orientations=[0, 0], labels='', trunklength=1.0, pathlengths=0.25,
250
- prior=None, connect=(0, 0), rotation=0, **kwargs):
+ def add(self, patchlabel='', flows=None, orientations=[0, 0], labels='',
+ trunklength=1.0, pathlengths=0.25, prior=None, connect=(0, 0),
+ rotation=0, **kwargs):
251
"""
252
Add a simple Sankey diagram with flows at the same hierarchical level.
253
@@ -328,7 +328,10 @@ def add(self, patchlabel='', flows=np.array([1.0, -1.0]),
328
:meth:`finish`
329
330
# Check and preprocess the arguments.
331
- flows = np.array(flows)
+ if flows is None:
332
+ flows = np.array([1.0, -1.0])
333
+ else:
334
+ flows = np.array(flows)
335
n = flows.shape[0] # Number of flows
336
if rotation == None:
337
rotation = 0
0 commit comments