matplotlib.pyplot.show()問題解決方法を表示しない

557 ワード

matplotlib.pyplot.show()が表示されない理由の1つは、matplotlibbackendagg形式に設定されていることであり、aggは画像を表示しないので、matplotlibを導入すると同時にmatplotlib.use('TkAgg')コマンドを直接使用してaggを設定することができる.backend公式解釈:https://matplotlib.org/tutorials/introductory/usage.html#what-is-a-backend
注意:matplotlib.use()は、import matplotlib.pyplotの前に使用する必要があります.(通常は、matplotlibが最初に導入されたときに設定できる、import matplotlib; matplotlib.use())