Skip to content

Commit 34186bd

Browse files
committed
Modifications as per discussion on GitHub today (api_changes.rst not changed).
1 parent 19ab81b commit 34186bd

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

examples/pylab_examples/pie_demo2.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@
66
like autolabeling the percentage, offsetting a slice with "explode"
77
and adding a shadow, in different sizes.
88
9-
Requires matplotlib0-0.70 or later
10-
119
"""
1210
from pylab import *
13-
import matplotlib.gridspec as gridspec
14-
import matplotlib.pyplot as pyplot
15-
11+
from matplotlib.gridspec import GridSpec
1612

1713
# Some data
1814

@@ -21,28 +17,27 @@
2117

2218
explode=(0, 0.05, 0, 0)
2319

24-
2520
# Make square figures and axes
2621

27-
the_grid = matplotlib.gridspec.GridSpec(2, 2)
22+
the_grid = GridSpec(2, 2)
2823

2924
figure(1, figsize=(6,6))
3025

31-
pyplot.subplot(the_grid[0, 0])
26+
subplot(the_grid[0, 0])
3227

33-
pie(fracs, labels = labels, autopct = '%1.1f%%', shadow = True)
28+
pie(fracs, labels=labels, autopct='%1.1f%%', shadow=True)
3429

35-
pyplot.subplot(the_grid[0, 1])
30+
subplot(the_grid[0, 1])
3631

37-
pie(fracs, explode=explode, labels = labels, autopct = '%1.1f%%', shadow = True)
32+
pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
3833

39-
pyplot.subplot(the_grid[1, 0])
34+
subplot(the_grid[1, 0])
4035

41-
pie(fracs, labels = labels, autopct = '%1.1f%%', shadow = True, radius = 0.5)
36+
pie(fracs, labels=labels, autopct='%1.1f%%', shadow=True, radius=0.5)
4237

43-
pyplot.subplot(the_grid[1, 1])
38+
subplot(the_grid[1, 1])
4439

45-
pie(fracs, explode=explode, labels = labels, autopct = '%1.1f%%', shadow = True,
46-
radius = 0.5)
40+
pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True,
41+
radius=0.5)
4742

4843
show()

lib/matplotlib/axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5011,7 +5011,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
50115011
50125012
pie(x, explode=None, labels=None,
50135013
colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
5014-
autopct=None, pctdistance=0.6, labeldistance=1.1, shadow=False,
5014+
autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1,
50155015
radius=None)
50165016
50175017
Make a pie chart of array *x*. The fractional area of each

0 commit comments

Comments
 (0)