Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5ddcb77

Browse filesBrowse files
committed
adressed pr review
1 parent a5c1d34 commit 5ddcb77
Copy full SHA for 5ddcb77

File tree

Expand file treeCollapse file tree

2 files changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-2
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3305,7 +3305,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
33053305

33063306
if not np.all(np.isfinite(x)):
33073307
raise ValueError('Wedge sizes must be finite numbers')
3308-
3308+
3309+
sx = x.sum()
33093310

33103311
if normalize:
33113312
x = x / sx

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9726,5 +9726,5 @@ def test_pie_non_finite_values():
97269726
fig, ax = plt.subplots()
97279727
df = [5, float('nan'), float('inf')]
97289728

9729-
with pytest.raises(ValueError, match = 'Wedge sizes must be finite numbers'):
9729+
with pytest.raises(ValueError, match='Wedge sizes must be finite numbers'):
97309730
ax.pie(df, labels=['A', 'B', 'C'])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.