This is an archival dump of old wiki content --- see for current material.
Please see

Use the bar function to make bar charts:

Here's an example script that makes a bar char with error bars and labels centered under the bars.

#!/usr/bin/env python
import numpy.numarray as na

from pylab import *

labels = ["Baseline", "System"]
data =   [3.75               , 4.75]
error =  [0.3497             , 0.3108]

xlocations = na.array(range(len(data)))+0.5
width = 0.5
bar(xlocations, data, yerr=error, width=width)
yticks(range(0, 8))
xticks(xlocations+ width/2, labels)
xlim(0, xlocations[-1]+width*2)
title("Average Ratings on the Training Set")


SciPy: Cookbook/Matplotlib/BarCharts (last edited 2015-10-24 17:48:25 by anonymous)