Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix typo in margins handling. #6544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
anntzer committed Jun 6, 2016
commit 655f5ae1f283ac49ecaad957584164665fe6f96e
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down