Skip to content

BUG : turned clipping off on pie chart components #2952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
2014-04-08 Fixed a bug in parasite_axes.py by making a list out
of a generator at line 263.

2014-04-02 Added `clipon=False` to patch creation of wedges and shadows
in `pie`.

2014-02-25 In backend_qt4agg changed from using update -> repaint under
windows. See comment in source near `self._priv_update` for
longer explaination.
Expand Down
16 changes: 10 additions & 6 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2328,8 +2328,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
autopct=None, pctdistance=0.6, shadow=False,
labeldistance=1.1, startangle=None, radius=None,
counterclock=True, wedgeprops=None, textprops=None,
)
counterclock=True, wedgeprops=None, textprops=None)

Make a pie chart of array *x*. The fractional area of each
wedge is given by x/sum(x). If sum(x) <= 1, then the values
Expand Down Expand Up @@ -2382,10 +2381,12 @@ def pie(self, x, explode=None, labels=None, colors=None,
For example, you can pass in wedgeprops = { 'linewidth' : 3 }
to set the width of the wedge border lines equal to 3.
For more details, look at the doc/arguments of the wedge object.
By default `clip_on=False`.

*textprops*: [ *None* | dict of key value pairs ]
Dict of arguments to pass to the text objects.


The pie chart will probably look best if the figure and axes are
square, or the Axes aspect is equal. e.g.::

Expand Down Expand Up @@ -2438,10 +2439,16 @@ def pie(self, x, explode=None, labels=None, colors=None,
else:
theta1 = startangle / 360.0

# set default values in wedge_prop
if wedgeprops is None:
wedgeprops = {}
if 'clip_on' not in wedgeprops:
wedgeprops['clip_on'] = False

if textprops is None:
textprops = {}
if 'clip_on' not in textprops:
textprops['clip_on'] = False

texts = []
slices = []
Expand All @@ -2467,10 +2474,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
# make sure to add a shadow after the call to
# add_patch so the figure and transform props will be
# set
shad = mpatches.Shadow(
w, -0.02, -0.02,
#props={'facecolor':w.get_facecolor()}
)
shad = mpatches.Shadow(w, -0.02, -0.02)
shad.set_zorder(0.9 * w.get_zorder())
shad.set_label('_nolegend_')
self.add_patch(shad)
Expand Down