Re: [matplotlib-devel] Patch to let specify pie chart text radius

2006-08-14 Thread Darren Dale
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.
[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch to let specify pie chart text radius

2006-08-14 Thread Asheesh Laroia

On Mon, 14 Aug 2006, John Hunter wrote:

Hey Asheesh -- sorry we missed this the first time.  I just tried to 
apply it but the patch didn't go through because of the dir naming 
conventions you are using on your system. Could you try to get an svn 
co, apply your patch, and then submit an 'svn diff' ?


That's attached.  Also, try using patch -p1 next time. (-;

I license this under the same terms at matplotlib is currently publicly 
distributed.


-- Asheesh.

--
Your boyfriend takes chocolate from strangers.Index: lib/matplotlib/axes.py
===
--- lib/matplotlib/axes.py  (revision 2688)
+++ lib/matplotlib/axes.py  (working copy)
@@ -2662,12 +2662,13 @@
 def pie(self, x, explode=None, labels=None,
 colors=None,
 autopct=None,
+pctdistance=0.6,
 shadow=False
 ):
 
 PIE(x, explode=None, labels=None,
 colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
-autopct=None, shadow=False)
+autopct=None, pctdistance=0.6, shadow=False)
 
 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 of x give the
@@ -2686,6 +2687,10 @@
 the wedge.  If it is a format string, the label will be fmt%pct.
 If it is a function, it will be called
 
+  - pctdistance is the ratio between the center of each pie slice
+and the start of the text generated by autopct.  Ignored if autopct
+is None; default is 0.6.
+
   - shadow, if True, will draw a shadow beneath the pie.
 
 The pie chart will probably look best if the figure and axes are
@@ -2760,8 +2765,8 @@
 texts.append(t)
 
 if autopct is not None:
-xt = x + 0.6*radius*math.cos(thetam)
-yt = y + 0.6*radius*math.sin(thetam)
+xt = x + pctdistance*radius*math.cos(thetam)
+yt = y + pctdistance*radius*math.sin(thetam)
 if is_string_like(autopct):
 s = autopct%(100.*frac)
 elif callable(autopct):
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel