ในการแก้ไขคำเตือนการเลิกใช้งานที่มาในขณะที่ใช้วิธีที่เลิกใช้แล้ว เราสามารถใช้ warnings.filterwarnings("ignore") ในรหัส.−
ตัวอย่าง
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() ผลลัพธ์
Process finished with exit code 0