Skip to content

Commit 438ac69

Browse files
committed
TST: Adding test to test_style (pandas-dev#3188)
1 parent ef9416c commit 438ac69

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pandas/tests/plotting/test_style.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import pytest
22

3-
from pandas import Series
3+
from pandas import (
4+
DataFrame,
5+
Series,
6+
)
47

58
pytest.importorskip("matplotlib")
69
from pandas.plotting._matplotlib.style import get_standard_colors
@@ -157,3 +160,14 @@ def test_empty_color_raises(self, color):
157160
def test_bad_color_raises(self, color):
158161
with pytest.raises(ValueError, match="Invalid color"):
159162
get_standard_colors(color=color, num_colors=5)
163+
164+
165+
class TestDefaultMplStyleParams:
166+
@pytest.mark.parametrize("rcGrid", [True, False])
167+
def test_mplback_df_plot_by_default_use_axes_grid_from_rcparams(self, rcGrid):
168+
import matplotlib as mpl
169+
170+
# GH 3188
171+
mpl.rcParams["axes.grid"] = rcGrid
172+
ax = DataFrame([1, 2, 3, 4, 5]).plot()
173+
assert mpl.rcParams["axes.grid"] == ax._gridOn

0 commit comments

Comments
 (0)