align
breaks rwidth for log-scaled histogram plots
#11506
Labels
Difficulty: Medium
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
keep
Items to be ignored by the “Stale” Github Action
New feature
topic: hist
topic: transforms and scales
Bug report
Bug summary
When plotting a histogram (
plt.hist
) on a log-scaled axis, using thealign
parameter to set either 'left' or 'right' alignments changes the width of bars when using therwidth
parameter. There are two plots from the below script attached. Each plot contains a group of three axes in an L-shape, the left set plots histograms using 'mid' for all alignments while the right set uses ['left', 'mid', 'right'] for alignments of the [red, blue, green] histograms respectively. The first example sets the x and y axes scales to 'linear' (which produces correct results) and second sets the scales to 'log', which messes up the widths of the histogram bars.Code for reproduction
Actual outcome
Linear axes look fine (widths of histograms in the right triad are all uniform):
Log axes the bar widths get screwed up (widths of histograms in the right triad are all different):
Matplotlib version
print(matplotlib.get_backend())
): MacOSXThe text was updated successfully, but these errors were encountered: