Pie chart

The pie command uses a matlab(TM) compatible syntax to produce py charts. Optional features include auto-labeling the percentage of area, "exploding" one or more wedges out from the center of the pie, and a shadow effect. Take a close look at the attached code that produced this figure; nine lines of code.

import pylab as pl
    
# make a square figure and axes
pl.figure(1, figsize=(8,8))
ax = pl.axes([0.1, 0.1, 0.8, 0.8])

labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
fracs = [15,30,45, 10]

explode=(0, 0.05, 0, 0)
pl.pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
pl.title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})