General formatting question for Pie / Bar charts

Hi, I’m hoping you can help. I’ve been reading through the matplotlib documentation but finding it fairly confusing.

I am plotting some pie and bar charts, example code would be similar to,

	def makepie(labels,slices,titlestring,outputname,FIGUREID,FIGSIZE):
for c in range(0,len(labels)):
colorrange.append(( 0.5 ,0.5,0.5+(c*(0.5/len(labels)))))
figure=plt.figure(FIGUREID, figsize=FIGSIZE)
chart=plt.pie(slices,labels=labels, shadow=True, colors=colorrange)
#update formatting
for pieslice in chart[1]: #0 is patches, 1 is text instances
figure.get_axes()[0].set_title(titlestring, bbox={'facecolor':'0.75', 'pad':6}, fontsize='x-small')

The trouble is, the resulting pie isn’t so pretty, and example is

I would like some general examples for updating the formatting - for example no matter what I have tried so far I cannot get the background to be transparent rather than white, I dont really understand how to adjust the positions of the labels and what options I have with the pie chart for doing that.

I did figure out the font size and type changes, but that was more a shot in the dark - I dont really understand the object I have programmatically or the ‘model’ behind matplotlib and how it constructs an image.

I understand this is a slightly vague question, but hope someone can help!




View this message in context: General formatting question for Pie / Bar charts

Sent from the matplotlib - users mailing list archive at