matplotlibで最初からフルスクリーンでplt.showする

matplotlibでimshowする時、引数を指定しないと常に決まった解像度で図が表示されてしまう。

最初からフルスクリーンで表示するには、以下のコードを書き込めばOK。

from matplotlib import pyplot as plt

mng = plt.get_current_fig_manager()
mng.resize(*mng.window.maxsize())

plt.show()

参考

How to maximize a plt.show() window
Just for curiosity I would like to know how to do this in the code below. I have been searching for an answer but is use...

matplotlib.pyplot.get_current_fig_manager — Matplotlib 3.3.3 documentation

matplotlib.backend_bases — Matplotlib 3.3.3 documentation

Bitly

コメント

タイトルとURLをコピーしました