Để khắc phục cảnh báo không dùng nữa xuất hiện khi sử dụng phương pháp không được dùng nữa, chúng tôi có thể sử dụng warning.filterwarnings ("bỏ qua") trong mã.−
Ví dụ
from matplotlib import pyplot as plt, pylab as pl
import warnings
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
warnings.filterwarnings("ignore")
pl.pause(0)
plt.show() Đầu ra
Process finished with exit code 0