8000 Broadcast 'orientations' arg to Sankey.add. by anntzer · Pull Request #13213 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Broadcast 'orientations' arg to Sankey.add. #13213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/matplotlib/sankey.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,14 @@ def add(self, patchlabel='', flows=None, orientations=None, labels='',
# In the code below, angles are expressed in deg/90.
rotation /= 90.0
if orientations is None:
orientations = [0, 0]
if len(orientations) != n:
orientations = 6028 0
try:
orientations = np.broadcast_to(orientations, n)
except ValueError:
raise ValueError(
"orientations and flows must have the same length.\n"
"orientations has length %d, but flows has length %d."
% (len(orientations), n))
f"The shapes of 'flows' {np.shape(flows)} and 'orientations' "
f"{np.shape(orientations)} are incompatible"
) from None
if not cbook.is_scalar_or_string(labels) and len(labels) != n:
raise ValueError(
"If labels is a list, then labels and flows must have the "
Expand Down
0