Skip to content

Commit

Permalink
Backport PR pandas-dev#59168: TST: Address UserWarning in matplotlib …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
mroeschke authored and meeseeksmachine committed Jul 3, 2024
1 parent 243457d commit d4e803c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pandas/plotting/_matplotlib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,13 @@ def _make_legend(self) -> None:
elif self.subplots and self.legend:
for ax in self.axes:
if ax.get_visible():
ax.legend(loc="best")
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
"No artists with labels found to put in legend.",
UserWarning,
)
ax.legend(loc="best")

@final
@staticmethod
Expand Down

0 comments on commit d4e803c

Please sign in to comment.