Barchart

The bar command takes error bars as an optional argument. You can also use up and down bars, stacked bars, 'candlestick' bars, etc. You can make horizontal bar charts with the barh command.

# a bar plot with errorbars
import pylab as pl

N = 5
menMeans = (20, 35, 30, 35, 27)
menStd =   ( 2,  3,  4,  1,  2)

ind = pl.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars
p1 = pl.bar(ind, menMeans, width, color='r', yerr=menStd)

womenMeans = (25, 32, 34, 20, 25)
womenStd =   ( 3,  5,  2,  3,  3)
p2 = pl.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)

pl.ylabel('Scores')
pl.title('Scores by group and gender')
pl.xticks(ind+width, ('G1', 'G2', 'G3', 'G4', 'G5') )
pl.xlim(-width,len(ind))
pl.yticks(pl.arange(0,41,10))

pl.legend( (p1[0], p2[0]), ('Men', 'Women'), shadow=True)