@@ -5005,18 +5005,20 @@ def stem(self, x, y, linefmt='b-', markerfmt='bo', basefmt='r-',
50055005
50065006 def pie (self , x , explode = None , labels = None , colors = None ,
50075007 autopct = None , pctdistance = 0.6 , shadow = False ,
5008- labeldistance = 1.1 ):
5008+ labeldistance = 1.1 , startangle = None ):
50095009 r"""
50105010 Call signature::
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, labeldistance=1.1,
5015+ shadow=False, startangle=None)
50155016
50165017 Make a pie chart of array *x*. The fractional area of each
50175018 wedge is given by x/sum(x). If sum(x) <= 1, then the values
50185019 of x give the fractional area directly and the array will not
5019- be normalized.
5020+ be normalized. The wedges are plotted counterclockwise,
5021+ by default starting from the x-axis.
50205022
50215023 Keyword arguments:
50225024
@@ -5048,6 +5050,10 @@ def pie(self, x, explode=None, labels=None, colors=None,
50485050 *shadow*: [ *False* | *True* ]
50495051 Draw a shadow beneath the pie.
50505052
5053+ *startangle*: [ *None* | Offset angle ]
5054+ If not *None*, rotates the start of the pie chart by *angle*
5055+ degrees counterclockwise from the x-axis.
5056+
50515057 The pie chart will probably look best if the figure and axes are
50525058 square. Eg.::
50535059
@@ -5085,8 +5091,14 @@ def pie(self, x, explode=None, labels=None, colors=None,
50855091
50865092 center = 0 ,0
50875093 radius = 1
5088- theta1 = 0
50895094 i = 0
5095+
5096+ # Starting theta1 is the start fraction of the circle
5097+ if startangle is None :
5098+ theta1 = 0
5099+ else :
5100+ theta1 = startangle / 360.0
5101+
50905102 texts = []
50915103 slices = []
50925104 autotexts = []
@@ -5151,8 +5163,10 @@ def pie(self, x, explode=None, labels=None, colors=None,
51515163 self .set_xticks ([])
51525164 self .set_yticks ([])
51535165
5154- if autopct is None : return slices , texts
5155- else : return slices , texts , autotexts
5166+ if autopct is None :
5167+ return slices , texts
5168+ else :
5169+ return slices , texts , autotexts
51565170
51575171 @docstring .dedent_interpd
51585172 def errorbar (self , x , y , yerr = None , xerr = None ,
0 commit comments