diff --git a/ultralytics/utils/__init__.py b/ultralytics/utils/__init__.py index 5fc0c71b724..ddc9ba3f896 100644 --- a/ultralytics/utils/__init__.py +++ b/ultralytics/utils/__init__.py @@ -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)