@@ -2336,7 +2336,8 @@ def stem(self, *args, **kwargs):
23362336
23372337 def pie (self , x , explode = None , labels = None , colors = None ,
23382338 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 ):
23402341 r"""
23412342 Plot a pie chart.
23422343
@@ -2345,7 +2346,9 @@ def pie(self, x, explode=None, labels=None, colors=None,
23452346 pie(x, explode=None, labels=None,
23462347 colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
23472348 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+ )
23492352
23502353 Make a pie chart of array *x*. The fractional area of each
23512354 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,
23932396 *counterclock*: [ *False* | *True* ]
23942397 Specify fractions direction, clockwise or counterclockwise.
23952398
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+
23962408 The pie chart will probably look best if the figure and axes are
23972409 square, or the Axes aspect is equal. e.g.::
23982410
@@ -2445,6 +2457,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
24452457 else :
24462458 theta1 = startangle / 360.0
24472459
2460+ if wedgeprops is None :
2461+ wedgeprops = {}
2462+ if textprops is None :
2463+ textprops = {}
2464+
24482465 texts = []
24492466 slices = []
24502467 autotexts = []
@@ -2459,7 +2476,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
24592476
24602477 w = mpatches .Wedge ((x , y ), radius , 360. * min (theta1 , theta2 ),
24612478 360. * max (theta1 , theta2 ),
2462- facecolor = colors [i % len (colors )])
2479+ facecolor = colors [i % len (colors )],
2480+ ** wedgeprops )
24632481 slices .append (w )
24642482 self .add_patch (w )
24652483 w .set_label (label )
@@ -2483,7 +2501,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
24832501 t = self .text (xt , yt , label ,
24842502 size = rcParams ['xtick.labelsize' ],
24852503 horizontalalignment = label_alignment ,
2486- verticalalignment = 'center' )
2504+ verticalalignment = 'center' ,
2505+ ** textprops )
24872506
24882507 texts .append (t )
24892508
@@ -2500,7 +2519,9 @@ def pie(self, x, explode=None, labels=None, colors=None,
25002519
25012520 t = self .text (xt , yt , s ,
25022521 horizontalalignment = 'center' ,
2503- verticalalignment = 'center' )
2522+ verticalalignment = 'center' ,
2523+ ** textprops )
2524+
25042525 autotexts .append (t )
25052526
25062527 theta1 = theta2
0 commit comments