Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Cách kiểm tra backend Matplotlib có chạy inline không


Dùng matplotlib.get_backend() để lấy tên backend hiện tại. Nếu trả về 'module://matplotlib_inline.backend_inline' thì đang chạy inline (Jupyter).

Ví dụ minh họa

import matplotlib
inline = matplotlib.get_backend()
print("Backend:", inline)

Kết quả đầu ra

Backend: Qt5Agg