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):
        colorrange=[]
        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)
        axes=figure.add_axes([0.1,0.1,0.8,0.8])
        chart=plt.pie(slices,labels=labels, shadow=True, colors=colorrange)
        #update formatting
        for pieslice in chart[1]: #0 is patches, 1 is text instances
                pieslice.set_fontname('Arial')
                pieslice.set_fontsize(6)
        figure.get_axes()[0].set_title(titlestring, bbox={'facecolor':'0.75',
'pad':6}, fontsize='x-small')
        plt.savefig(outputname)

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

http://www.nabble.com/file/p26060403/client_by_migtime.png 

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!

Thanks,

Matt.

-- 
View this message in context: 
http://www.nabble.com/General-formatting-question-for-Pie---Bar-charts-tp26060403p26060403.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to