matplotlib.pyplot.show()問題解決方法を表示しない
557 ワード
matplotlib.pyplot.show()
が表示されない理由の1つは、matplotlib
のbackend
がagg
形式に設定されていることであり、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()
)