Patch to let specify pie chart text radius

For pie charts, autopct lets a format string with the pie's value be printed on the chart. The default fraction of the radius that the text is printed at is 0.6; I wanted the text farther out at 0.85.

This small patch (against matplotlib 0.87.4) allows one to customize that radius by a new keyword argument, pctradius. The old behavior is still the default.

It works with the pylab interface because pylab.pie passes kwargs through.

I would love it if this were accepted into the main tarball; I hereby place this patch into the public domain, so there are no copyright restrictions on incorporating it into the matplotlib distribution.

Comments/questions welcome. I'm subscribed to matplotlib-devel.

-- Asheesh.

pie-pctradius.patch (1.88 KB)

···

--
It is easy to find fault, if one has that disposition. There was once a man
who, not being able to find any other fault with his coal, complained that
there were too many prehistoric toads in it.
     -- Mark Twain, "Pudd'nhead Wilson's Calendar"

This patch does not change default behavior but provides a useful feature enhancement that we use at Creative Commons. It would be great if you, our humble upstream, would accept it in the new point release. Would you?

Thanks! I'm subscribed to matplotlib-devel and welcome comments. I've re-attached the patch in the case that it got lost.

-- Asheesh.

pie-pctradius.patch (1.88 KB)

···

On Tue, 18 Jul 2006, Asheesh Laroia wrote:

For pie charts, autopct lets a format string with the pie's value be printed on the chart. The default fraction of the radius that the text is printed at is 0.6; I wanted the text farther out at 0.85.

This small patch (against matplotlib 0.87.4) allows one to customize that radius by a new keyword argument, pctradius. The old behavior is still the default.

--
You are a bundle of energy, always on the go.

Hi Asheesh,

It looks like your first email got overlooked. Sorry about that. Would you
also post a bug report at the sourceforge webpage? I'll look at your patch
when I get a chance.

Darren

···

On Monday 14 August 2006 8:17 pm, Asheesh Laroia wrote:

On Tue, 18 Jul 2006, Asheesh Laroia wrote:
> For pie charts, autopct lets a format string with the pie's value be
> printed on the chart. The default fraction of the radius that the text
> is printed at is 0.6; I wanted the text farther out at 0.85.
>
> This small patch (against matplotlib 0.87.4) allows one to customize that
> radius by a new keyword argument, pctradius. The old behavior is still
> the default.

This patch does not change default behavior but provides a useful feature
enhancement that we use at Creative Commons. It would be great if you,
our humble upstream, would accept it in the new point release. Would you?

Thanks! I'm subscribed to matplotlib-devel and welcome comments. I've
re-attached the patch in the case that it got lost.

-- Asheesh.

--
Darren S. Dale, Ph.D.
dd55@...143...