Skip to content

Commit 4f56b2d

Browse files
authored
TST: fix warning for pie chart (#37669)
1 parent 68e5b4c commit 4f56b2d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pandas/tests/plotting/test_frame.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -2650,11 +2650,20 @@ def test_pie_df(self):
26502650
self._check_colors(ax.patches, facecolors=color_args)
26512651

26522652
def test_pie_df_nan(self):
2653+
import matplotlib as mpl
2654+
26532655
df = DataFrame(np.random.rand(4, 4))
26542656
for i in range(4):
26552657
df.iloc[i, i] = np.nan
26562658
fig, axes = self.plt.subplots(ncols=4)
2657-
df.plot.pie(subplots=True, ax=axes, legend=True)
2659+
2660+
# GH 37668
2661+
kwargs = {}
2662+
if mpl.__version__ >= "3.3":
2663+
kwargs = {"normalize": True}
2664+
2665+
with tm.assert_produces_warning(None):
2666+
df.plot.pie(subplots=True, ax=axes, legend=True, **kwargs)
26582667

26592668
base_expected = ["0", "1", "2", "3"]
26602669
for i, ax in enumerate(axes):

0 commit comments

Comments
 (0)