Closed
Description
Bug report
Bug summary
Docstring for plt.bar:
matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs)
Make a bar plot.Make a bar plot with rectangles bounded by:
left, left + width, bottom, bottom + height
(left, right, bottom and top edges)
However, "left" is in fact the center value of the resulting bars.
Code for reproduction
# Paste your code here
#
#
import numpy as np
import matplotlib.pyplot as plt
lefts = np.asarray((0, 100, 200, 300, 400))
plt.bar(left=lefts, height=lefts, width=100)
plt.bar(left=lefts, height=lefts, width=75)
plt.bar(left=lefts, height=lefts, width=50)
plt.bar(left=lefts, height=lefts, width=25)
# If applicable, paste the console output here
#
#
Expected outcome
Bars should be left-aligned to the "left" value.
As the attached plot shows: Bars are centered on "left" value, and not left-aligned to it.
Matplotlib version
- Operating System: Fedora Linux 26
- Matplotlib Version: 2.0.2
- Python Version: 3.6
- Jupyter Version (if applicable):
- Other Libraries:
matplotlib installed using pip