私は新しい評判よりも他の印を残すことはできません 私はWindows(WIN7)で、Python 2.7.5を実行しています& Matplotlib 1.3。
from matplotlib import pyplot as plt
### for 'TkAgg' backend
plt.figure(1)
plt.switch_backend('TkAgg') #TkAgg (instead Qt4Agg)
print '#1 Backend:',plt.get_backend()
plt.plot([1,2,6,4])
mng = plt.get_current_fig_manager()
### works on Ubuntu??? >> did NOT working on windows
# mng.resize(*mng.window.maxsize())
mng.window.state('zoomed') #works fine on Windows!
plt.show() #close the figure to run the next section
### for 'wxAgg' backend
plt.figure(2)
plt.switch_backend('wxAgg')
print '#2 Backend:',plt.get_backend()
plt.plot([1,2,6,4])
mng = plt.get_current_fig_manager()
mng.frame.Maximize(True)
plt.show() #close the figure to run the next section
### for 'Qt4Agg' backend
plt.figure(3)
plt.switch_backend('QT4Agg') #default on my system
print '#3 Backend:',plt.get_backend()
plt.plot([1,2,6,4])
figManager = plt.get_current_fig_manager()
figManager.window.showMaximized()
plt.show()
ホープ実施例で合成前の答え(およびいくつかの追加)のこの要約(AT:
1私は、次の行を使用してTkAgg、QT4Agg、及びwxAggについては、図ウィンドウを最大化することができました少なくともウィンドウのために)役立ちます。 乾杯。
これを使って、mng.frame.Maximize(True)を取得します。 AttributeError:FigureManagerTkAggインスタンスにMatplotlib 1.2.0の属性 'frame'がありません。 – Junuxx
上記はWindows上で動作します。 Mac? – gg349
いいえ、私はWindows上です。 – Junuxx