From 76cd3dd0f55fb8dc77b28f3cd26bca2dada4c736 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 10 Dec 2016 20:28:12 -0500 Subject: [PATCH] Make bars stick to explicitly-specified edges. Previously, they would stick to 0 regardless of any explicit bottom/left position specified by the respective keyword arguments. --- examples/pylab_examples/log_bar.py | 1 - lib/matplotlib/axes/_axes.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/pylab_examples/log_bar.py b/examples/pylab_examples/log_bar.py index 8e18c00767a4..362b123ebaa4 100644 --- a/examples/pylab_examples/log_bar.py +++ b/examples/pylab_examples/log_bar.py @@ -17,6 +17,5 @@ y = [d[i] for d in data] b = plt.bar(x + i * dimw, y, dimw, bottom=0.001) plt.xticks(x + w / 2) -plt.ylim((0.001, 1000)) plt.show() diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 0f415587f733..bcfaf7130cc8 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2128,9 +2128,9 @@ def make_iterable(x): r.update(kwargs) r.get_path()._interpolation_steps = 100 if orientation == 'vertical': - r.sticky_edges.y.append(0) + r.sticky_edges.y.append(b) elif orientation == 'horizontal': - r.sticky_edges.x.append(0) + r.sticky_edges.x.append(l) self.add_patch(r) patches.append(r)