From 655f5ae1f283ac49ecaad957584164665fe6f96e Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 6 Jun 2016 10:37:27 -0700 Subject: [PATCH] Fix typo in margins handling. This does not change the semantics of the code but should make things clearer and offer a negligible optimization: previously, the margins correction would be computed even if `margin == 0` as long as `do_upper_margin` was set. --- lib/matplotlib/axes/_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index ff36b433dd07..6314dc9d6b67 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2250,7 +2250,7 @@ def handle_single_axis(scale, autoscaleon, shared_axes, interval, x0, x1 = mtransforms.nonsingular( x0, x1, increasing=False, expander=0.05) - if (margin > 0 and do_lower_margin or do_upper_margin): + if margin > 0 and (do_lower_margin or do_upper_margin): if axis.get_scale() == 'linear': delta = (x1 - x0) * margin if do_lower_margin: