@@ -2336,7 +2336,8 @@ def stem(self, *args, **kwargs):
2336
2336
2337
2337
def pie (self , x , explode = None , labels = None , colors = None ,
2338
2338
autopct = None , pctdistance = 0.6 , shadow = False , labeldistance = 1.1 ,
2339
- startangle = None , radius = None , counterclock = True ):
2339
+ startangle = None , radius = None , counterclock = True ,
2340
+ wedgeprops = None , textprops = None ):
2340
2341
r"""
2341
2342
Plot a pie chart.
2342
2343
@@ -2345,7 +2346,9 @@ def pie(self, x, explode=None, labels=None, colors=None,
2345
2346
pie(x, explode=None, labels=None,
2346
2347
colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
2347
2348
autopct=None, pctdistance=0.6, shadow=False,
2348
- labeldistance=1.1, startangle=None, radius=None)
2349
+ labeldistance=1.1, startangle=None, radius=None,
2350
+ counterclock=True, wedgeprops=None, textprops=None,
2351
+ )
2349
2352
2350
2353
Make a pie chart of array *x*. The fractional area of each
2351
2354
wedge is given by x/sum(x). If sum(x) <= 1, then the values
@@ -2393,6 +2396,15 @@ def pie(self, x, explode=None, labels=None, colors=None,
2393
2396
*counterclock*: [ *False* | *True* ]
2394
2397
Specify fractions direction, clockwise or counterclockwise.
2395
2398
2399
+ *wedgeprops*: [ *None* | dict of key value pairs ]
2400
+ Dict of arguments passed to the wedge objects making the pie.
2401
+ For example, you can pass in wedgeprops = { 'linewidth' : 3 }
2402
+ to set the width of the wedge border lines equal to 3.
2403
+ For more details, look at the doc/arguments of the wedge object.
2404
+
2405
+ *textprops*: [ *None* | dict of key value pairs ]
2406
+ Dict of arguments to pass to the text objects.
2407
+
2396
2408
The pie chart will probably look best if the figure and axes are
2397
2409
square, or the Axes aspect is equal. e.g.::
2398
2410
@@ -2445,6 +2457,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
2445
2457
else :
2446
2458
theta1 = startangle / 360.0
2447
2459
2460
+ if wedgeprops is None :
2461
+ wedgeprops = {}
2462
+ if textprops is None :
2463
+ textprops = {}
2464
+
2448
2465
texts = []
2449
2466
slices = []
2450
2467
autotexts = []
@@ -2459,7 +2476,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
2459
2476
2460
2477
w = mpatches .Wedge ((x , y ), radius , 360. * min (theta1 , theta2 ),
2461
2478
360. * max (theta1 , theta2 ),
2462
- facecolor = colors [i % len (colors )])
2479
+ facecolor = colors [i % len (colors )],
2480
+ ** wedgeprops )
2463
2481
slices .append (w )
2464
2482
self .add_patch (w )
2465
2483
w .set_label (label )
@@ -2483,7 +2501,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
2483
2501
t = self .text (xt , yt , label ,
2484
2502
size = rcParams ['xtick.labelsize' ],
2485
2503
horizontalalignment = label_alignment ,
2486
- verticalalignment = 'center' )
2504
+ verticalalignment = 'center' ,
2505
+ ** textprops )
2487
2506
2488
2507
texts .append (t )
2489
2508
@@ -2500,7 +2519,9 @@ def pie(self, x, explode=None, labels=None, colors=None,
2500
2519
2501
2520
t = self .text (xt , yt , s ,
2502
2521
horizontalalignment = 'center' ,
2503
- verticalalignment = 'center' )
2522
+ verticalalignment = 'center' ,
2523
+ ** textprops )
2524
+
2504
2525
autotexts .append (t )
2505
2526
2506
2527
theta1 = theta2
0 commit comments