Skip to content

Commit

Permalink
[GH-16333] fix pyplot warning (#16381) (#16441)
Browse files Browse the repository at this point in the history
Co-authored-by: krasinski <[email protected]>
  • Loading branch information
wendycwong and krasinski authored Oct 30, 2024
1 parent 4056d47 commit 421def8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion h2o-py/h2o/plot/_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ def get_matplotlib_pyplot(server, raise_if_not_available=False):
# noinspection PyUnresolvedReferences
import matplotlib
if server:
matplotlib.use("Agg")
if matplotlib.get_backend() != "Agg":
import matplotlib.pyplot as plt
plt.close('all')
matplotlib.use("Agg")
try:
# noinspection PyUnresolvedReferences
import matplotlib.pyplot as plt
Expand Down

0 comments on commit 421def8

Please sign in to comment.