[Tutor] matplotlib.pylab.plotfile formatting help

Sean Carolan scarolan at gmail.com
Mon Jan 3 21:59:15 CET 2011


I've got a csv file that contains two data fields, the short name of a
month and an integer.  I'm experimenting with pylab and ipython to get
a feel for how pylab works.  I'm able to generate a bar graph from my
data, but there are two problems with it:

1.  I don't want "2011" appended to the month names.  This data is
from 2010, and I only want the short month name under each bar.
2.  The bars are very narrow and I'm not sure how to widen them.

Here's my CSV data, stored in a file called csvdata.csv:

month,systems
Jan,17
Feb,49
Mar,77
Apr,59
May,42
Jun,137
Jul,102
Aug,115
Sep,57
Oct,134
Nov,131
Dec,197

And here's the "ipython -pylab" command that I'm using to generate the graph:

plotfile('csvdata.csv', ('month', 'systems'), plotfuncs={'systems': 'bar'},)

I've read through some of the documentation for matplotlib, but having
never used matlab or pylab before today it's a bit confusing.  Does
anyone know how to solve #1 and #2 above?


More information about the Tutor mailing list