@@ -2320,7 +2320,8 @@ def stem(self, *args, **kwargs):
23202320 def pie (self , x , explode = None , labels = None , colors = None ,
23212321 autopct = None , pctdistance = 0.6 , shadow = False , labeldistance = 1.1 ,
23222322 startangle = None , radius = None , counterclock = True ,
2323- wedgeprops = None , textprops = None ):
2323+ wedgeprops = None , textprops = None , center = (0 , 0 ),
2324+ frame = False ):
23242325 r"""
23252326 Plot a pie chart.
23262327
@@ -2330,7 +2331,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
23302331 colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
23312332 autopct=None, pctdistance=0.6, shadow=False,
23322333 labeldistance=1.1, startangle=None, radius=None,
2333- counterclock=True, wedgeprops=None, textprops=None)
2334+ counterclock=True, wedgeprops=None, textprops=None,
2335+ center = (0, 0), frame = False )
23342336
23352337 Make a pie chart of array *x*. The fractional area of each
23362338 wedge is given by x/sum(x). If sum(x) <= 1, then the values
@@ -2388,6 +2390,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
23882390 *textprops*: [ *None* | dict of key value pairs ]
23892391 Dict of arguments to pass to the text objects.
23902392
2393+ *center*: [ (0,0) | sequence of 2 scalars ]
2394+ Center position of the chart.
2395+
2396+ *frame*: [ *False* | *True* ]
2397+ Plot axes frame with the chart.
23912398
23922399 The pie chart will probably look best if the figure and axes are
23932400 square, or the Axes aspect is equal. e.g.::
@@ -2414,7 +2421,6 @@ def pie(self, x, explode=None, labels=None, colors=None,
24142421 :class:`~matplotlib.text.Text` instances for the numeric
24152422 labels.
24162423 """
2417- self .set_frame_on (False )
24182424
24192425 x = np .asarray (x ).astype (np .float32 )
24202426
@@ -2431,7 +2437,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
24312437 if colors is None :
24322438 colors = ('b' , 'g' , 'r' , 'c' , 'm' , 'y' , 'k' , 'w' )
24332439
2434- center = 0 , 0
2440+
24352441 if radius is None :
24362442 radius = 1
24372443
@@ -2514,10 +2520,12 @@ def pie(self, x, explode=None, labels=None, colors=None,
25142520 theta1 = theta2
25152521 i += 1
25162522
2517- self .set_xlim ((- 1.25 , 1.25 ))
2518- self .set_ylim ((- 1.25 , 1.25 ))
2519- self .set_xticks ([])
2520- self .set_yticks ([])
2523+ if not frame :
2524+ self .set_frame_on (False )
2525+ self .set_xlim ((- 1.25 , 1.25 ))
2526+ self .set_ylim ((- 1.25 , 1.25 ))
2527+ self .set_xticks ([])
2528+ self .set_yticks ([])
25212529
25222530 if autopct is None :
25232531 return slices , texts
0 commit comments