diff --git a/pandas/tests/plotting/test_frame.py b/pandas/tests/plotting/test_frame.py index f42f86540e46b..9a2b87558b869 100644 --- a/pandas/tests/plotting/test_frame.py +++ b/pandas/tests/plotting/test_frame.py @@ -800,7 +800,10 @@ def test_line_area_stacked(self): with pytest.raises(ValueError): mixed_df.plot(stacked=True) - _check_plot_works(df.plot, kind=kind, logx=True, stacked=True) + # Use an index with strictly positive values, preventing + # matplotlib from warning about ignoring xlim + df2 = df.set_index(df.index + 1) + _check_plot_works(df2.plot, kind=kind, logx=True, stacked=True) def test_line_area_nan_df(self): values1 = [1, 2, np.nan, 3]