@@ -2321,7 +2321,8 @@ def stem(self, *args, **kwargs):
23212321 def pie (self , x , explode = None , labels = None , colors = None ,
23222322 autopct = None , pctdistance = 0.6 , shadow = False , labeldistance = 1.1 ,
23232323 startangle = None , radius = None , counterclock = True ,
2324- wedgeprops = None , textprops = None ):
2324+ wedgeprops = None , textprops = None , center = (0 , 0 ),
2325+ frame = False ):
23252326 r"""
23262327 Plot a pie chart.
23272328
@@ -2331,7 +2332,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
23312332 colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
23322333 autopct=None, pctdistance=0.6, shadow=False,
23332334 labeldistance=1.1, startangle=None, radius=None,
2334- counterclock=True, wedgeprops=None, textprops=None)
2335+ counterclock=True, wedgeprops=None, textprops=None,
2336+ center = (0, 0), frame = False )
23352337
23362338 Make a pie chart of array *x*. The fractional area of each
23372339 wedge is given by x/sum(x). If sum(x) <= 1, then the values
@@ -2389,6 +2391,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
23892391 *textprops*: [ *None* | dict of key value pairs ]
23902392 Dict of arguments to pass to the text objects.
23912393
2394+ *center*: [ (0,0) | sequence of 2 scalars ]
2395+ Center position of the chart.
2396+
2397+ *frame*: [ *False* | *True* ]
2398+ Plot axes frame with the chart.
23922399
23932400 The pie chart will probably look best if the figure and axes are
23942401 square, or the Axes aspect is equal. e.g.::
@@ -2415,7 +2422,6 @@ def pie(self, x, explode=None, labels=None, colors=None,
24152422 :class:`~matplotlib.text.Text` instances for the numeric
24162423 labels.
24172424 """
2418- self .set_frame_on (False )
24192425
24202426 x = np .asarray (x ).astype (np .float32 )
24212427
@@ -2432,7 +2438,6 @@ def pie(self, x, explode=None, labels=None, colors=None,
24322438 if colors is None :
24332439 colors = ('b' , 'g' , 'r' , 'c' , 'm' , 'y' , 'k' , 'w' )
24342440
2435- center = 0 , 0
24362441 if radius is None :
24372442 radius = 1
24382443
@@ -2515,10 +2520,15 @@ def pie(self, x, explode=None, labels=None, colors=None,
25152520 theta1 = theta2
25162521 i += 1
25172522
2518- self .set_xlim ((- 1.25 , 1.25 ))
2519- self .set_ylim ((- 1.25 , 1.25 ))
2520- self .set_xticks ([])
2521- self .set_yticks ([])
2523+ if not frame :
2524+ self .set_frame_on (False )
2525+
2526+ self .set_xlim ((- 1.25 + center [0 ],
2527+ 1.25 + center [0 ]))
2528+ self .set_ylim ((- 1.25 + center [1 ],
2529+ 1.25 + center [1 ]))
2530+ self .set_xticks ([])
2531+ self .set_yticks ([])
25222532
25232533 if autopct is None :
25242534 return slices , texts
0 commit comments