// add some text for labels, title and axes ticks
ax.set_ylabel("Scores")
ax.set_title("Scores by group and gender")
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(("G1", "G2", "G3", "G4", "G5"))
ax.legend((rects1[0], rects2[0]), ("Men", "Women"))
After Change
import numpy as np
import matplotlib.pyplot as plt
men_means, men_std = (20, 35, 30, 35, 27), (2, 3, 4, 1, 2)
women_means, women_std = (25, 32, 34, 20, 25), (3, 5, 2, 3, 3)
ind = np.arange(len(men_means)) // the x locations for the groups