mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 05:24:22 +08:00
Compare plt.get_backend()
in lowercase (#8409)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
d6edf1c1d8
commit
60b6cab6cf
@ -212,7 +212,7 @@ def plt_settings(rcparams=None, backend="Agg"):
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user