overlapping text in pie plot


My boss asked me to provide a list of the source-code distribution per
folder in a project.
Using cloc http://cloc.sourceforge.net/ and some python give me all the numbers.

The problem comes when using pie to display the result, since many folders have
a small distribution, labels are printed ontop of each other making it
impossible to

Using linux-2.6.34 kernel as an example:

#!/usr/bin/env python

from pylab import *

dirs=['arch', 'block', 'crypto', 'Documentation', 'drivers',
'firmware', 'fs', 'include', 'init', 'ipc', 'kernel', 'lib', 'mm',
'net', 'samples', 'scripts', 'security', 'sound', 'tools', 'usr',

fracs=[100*i/float(result[0]) for i in result[1:]]

#difficult to see all the pie-elements,
for f,l in zip(fracs,dirs):
    print l.rjust(20),round(f,2),'\t%'

# make a square figure and axes
figure(1, figsize=(8,8))
ax = axes([0.1, 0.1, 0.8, 0.8])
p=pie(fracs, labels=dirs)

some googling gives this thread:

but that doesn't solve the problem, just makes it different...

Anyone know of a solution to this problem?


Different, but much easier to solve.
Unfortunately, Matplotlib does not provide any solution for now.

If you're familiar with Python and matplotlib, you may try to code it
by yourself. Otherwise, it may better find other library that does
this for you.




On Mon, May 24, 2010 at 10:04 AM, Fredrik Pihl <pi.arctan@...287...> wrote:

some googling gives this thread:
[Matplotlib-users] Overlapping labels in pie charts

but that doesn't solve the problem, just makes it different...