Closed
Description
Bug report
Bug summary
The polygon perimeter created by hist()
with histtype='stepfilled'
in
combination with a non-None bottom
argument has an invalid starting point.
This leads to a skewed lower edge of the first bin.
Code for reproduction
import matplotlib.pyplot as plt
# Data
data = [0, 0, 1, 1, 1]
# Bin edges
bins = [0, 1, 2]
plt.hist(data,
bins=bins,
bottom=[1, 2], # Set lower edge
histtype='stepfilled')
plt.savefig("example.png")
Expected outcome
The lower left point of the first bin should at coordinates (0, 1)
.
Matplotlib version
- Operating system: Debian (
python:3.7
Docker image) - Matplotlib version: 3.1.2
- Matplotlib backend (
print(matplotlib.get_backend())
): agg - Python version: 3.7.5
- matplotlib installed via pip
Metadata
Metadata
Assignees
Labels
No labels