2 import matplotlib.pyplot as plt
5 ind = np.arange(N) # the x locations for the groups
6 width = 0.35 # the width of the bars
8 # Shenanigans because I'm using generated data
9 cumulative = np.zeros(N)
13 sigma = np.random.rand()*10 + 10
14 mu = np.random.rand()*10 + 50
15 means = np.abs(sigma*np.random.randn(N) + mu)
16 Stds = np.abs(np.random.rand(N)*2 + 2)
18 p = plt.bar(ind, means, width, yerr=Stds,
20 cumulative = cumulative + means
21 legends = legends + (p[0],)
24 plt.title('Scores by group and treatment')
25 plt.xticks(ind, ('G1', 'G2', 'G3', 'G4', 'G5'))
26 plt.yticks(np.arange(0, max(cumulative), 30))
28 plt.legend(legends, range(1, len(legends) + 1))