Skip to content

Commit

Permalink
Compare plt.get_backend() in lowercase (ultralytics#8409)
Browse files Browse the repository at this point in the history
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
2 people authored and hmurari committed Apr 17, 2024
1 parent c48badf commit 70e656d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ultralytics/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def decorator(func):
def wrapper(*args, **kwargs):
"""Sets rc parameters and backend, calls the original function, and restores the settings."""
original_backend = plt.get_backend()
if backend != original_backend:
if backend.lower() != original_backend.lower():
plt.close("all") # auto-close()ing of figures upon backend switching is deprecated since 3.8
plt.switch_backend(backend)

Expand Down

0 comments on commit 70e656d

Please sign in to comment.