There are two issues with your current code. First, you are setting the x limits of your plot to [1, 40], which causes the last red bar to be clipped out. You should set it to [1, 40 + width]. Second, the set_xticks() needs to be shifted by width. However, doing so will change the values. So, it seems that if you change
plt.xticks(ind + width, ind)
The ticks will be placed at the positions ‘ind + width’, but with the values ‘ind’. I hope this helps.
On Mon, Jul 19, 2010 at 9:55 AM, Bala subramanian <bala.biophysics@…287…> wrote:
Attached a script test.py and 2 data files using with which i am trying to make a bar plot. The output is coming nice, but the x-ticks are placed at the left edge of the first bar. I want to make the xticks at the center between the two bars to have a better visualization. I dnt get which arguement i should use to get the xticks at the center of the two bars as in the following example