Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d67d93f

Browse files
committed
Merge branch 'pie_angle' of https://github.com/epeisach/matplotlib into epeisach-pie_angle
Conflicts: CHANGELOG matplotlib.png
2 parents 8e99098 + 7fb1c98 commit d67d93f

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

CHANGELOG

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
2012-05-22 Collections now have a setting "offset_position" to select whether
2-
the offsets are given in "screen" coordinates (default,
3-
following the old behavior) or "data" coordinates. This is currently
4-
used internally to improve the performance of hexbin.
2+
the offsets are given in "screen" coordinates (default,
3+
following the old behavior) or "data" coordinates. This is currently
4+
used internally to improve the performance of hexbin.
55

6-
As a result, the "draw_path_collection" backend methods have grown
7-
a new argument "offset_position". - MGD
6+
As a result, the "draw_path_collection" backend methods have grown
7+
a new argument "offset_position". - MGD
8+
9+
2012-05-04 Add a new argument to pie charts - startingangle - that
10+
allows one to specify the angle offset to the first wedge
11+
of the chart. - EP
812

913
2012-05-03 symlog scale now obeys the logarithmic base. Previously, it was
10-
completely ignored and always treated as base e. - MGD
14+
completely ignored and always treated as base e. - MGD
1115

1216
2012-05-03 Allow linscalex/y keyword to symlog scale that allows the size of
13-
the linear portion relative to the logarithmic portion to be
14-
adjusted. - MGD
17+
the linear portion relative to the logarithmic portion to be
18+
adjusted. - MGD
1519

1620
2012-04-06 When path clipping changes a LINETO to a MOVETO, it also
1721
changes any CLOSEPOLY command to a LINETO to the initial

lib/matplotlib/axes.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5005,13 +5005,14 @@ 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
@@ -5048,6 +5049,10 @@ def pie(self, x, explode=None, labels=None, colors=None,
50485049
*shadow*: [ *False* | *True* ]
50495050
Draw a shadow beneath the pie.
50505051
5052+
*startangle*: [ *None* | Offset angle ]
5053+
If not *None*, rotates the start of the pie chart by *angle*
5054+
degrees.
5055+
50515056
The pie chart will probably look best if the figure and axes are
50525057
square. Eg.::
50535058
@@ -5085,8 +5090,14 @@ def pie(self, x, explode=None, labels=None, colors=None,
50855090

50865091
center = 0,0
50875092
radius = 1
5088-
theta1 = 0
50895093
i = 0
5094+
5095+
# Starting theta1 is the start fraction of the circle
5096+
if startangle is None:
5097+
theta1 = 0
5098+
else:
5099+
theta1 = startangle / 360.0
5100+
50905101
texts = []
50915102
slices = []
50925103
autotexts = []

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,15 +2442,15 @@ def pcolormesh(*args, **kwargs):
24422442
# This function was autogenerated by boilerplate.py. Do not edit as
24432443
# changes will be lost
24442444
@autogen_docstring(Axes.pie)
2445-
def pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.59999999999999998, shadow=False, labeldistance=1.1000000000000001, hold=None):
2445+
def pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=None, hold=None):
24462446
ax = gca()
24472447
# allow callers to override the hold state by passing hold=True|False
24482448
washold = ax.ishold()
24492449

24502450
if hold is not None:
24512451
ax.hold(hold)
24522452
try:
2453-
ret = ax.pie(x, explode, labels, colors, autopct, pctdistance, shadow, labeldistance)
2453+
ret = ax.pie(x, explode, labels, colors, autopct, pctdistance, shadow, labeldistance, startangle)
24542454
draw_if_interactive()
24552455
finally:
24562456
ax.hold(washold)

0 commit comments

Comments
 (0)