Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Description
Bug report
Bug summary
There is an inconsistency between thematplotlib's documentation and actual outcome of the bar plot function. The documentation says thatleft
argument in the bar plot function indicate
the x coordinates of the left sides of the bars
In fact, theleft
parameter indicate the center of the bar.
Code for reproduction
importmatplotlib.pyplotaspltimportnumpyasnpN=3width=1.0stat= [2.4,3.2,1.6]ind=np.arange(1,6,2,dtype=np.float32)fig,ax=plt.subplots()ax.bar(ind,stat,width )ax.set_xticks(ind+width/2.0)plt.show()
Actual outcome and expected outcome
The x axis ticks should be in the center of bar if the documentation is right. In fact, the ticks are in the right side of each bar. See figure below
Matplotlib version
- Matplotlib version: 2.0.0
- Python version: 2.7.13 and 3.5.2
- Platform: Linux (CentOS 7) and Windows
- How did you install Matplotlib and Python: Anaconda