
上QQ阅读APP看书,第一时间看更新
How it works...
Here is the explanation for the code:
- ax.set_xticks(ind + width / 2) sets where exactly each tick is to be placed on x axis. Since ind is defined based on the men's data, it would place the ticks in the middle of the men's bars (light blue), and by adding width/2 to each of those indices we are moving the ticks to in-between the two bars.
- ax.set_xticklabels(('C1', 'C2', 'C3', 'C4', 'C5')) sets ticklabels on the x axis: