From 0ab9ab4b186db7c5a780a2ba2d09332f8e48f45e Mon Sep 17 00:00:00 2001 From: apcamargo Date: Fri, 11 Aug 2017 14:57:12 -0300 Subject: [PATCH] Fix #15495 `ax.set_xlim(left, right)` in `_make_plot()` is used only if the Matplotlib version is <2.0.0 --- pandas/plotting/_core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index e5b9497993172..be680e1268719 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -31,7 +31,8 @@ from pandas.util._decorators import Appender from pandas.plotting._compat import (_mpl_ge_1_3_1, - _mpl_ge_1_5_0) + _mpl_ge_1_5_0, + _mpl_ge_2_0_0) from pandas.plotting._style import (mpl_stylesheet, plot_params, _get_standard_colors) from pandas.plotting._tools import (_subplots, _flatten, table, @@ -965,7 +966,8 @@ def _make_plot(self): lines = _get_all_lines(ax) left, right = _get_xlim(lines) - ax.set_xlim(left, right) + if not _mpl_ge_2_0_0(): + ax.set_xlim(left, right) @classmethod def _plot(cls, ax, x, y, style=None, column_num=None,