Python 在matplotlib图形窗口中禁用窗口最大化
是否有任何可能的方法来禁用matplotlib地物窗口中的地物最大化按钮?我使用的是Ubuntu 13.10。如果您使用Python 在matplotlib图形窗口中禁用窗口最大化,python,matplotlib,Python,Matplotlib,是否有任何可能的方法来禁用matplotlib地物窗口中的地物最大化按钮?我使用的是Ubuntu 13.10。如果您使用PyQt作为后端,您可以这样做: import matplotlib.pyplot as plt from PyQt4.QtCore import Qt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(10),range(10)) #get the parent window of the canvas
PyQt
作为后端,您可以这样做:
import matplotlib.pyplot as plt
from PyQt4.QtCore import Qt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(10),range(10))
#get the parent window of the canvas and set the flags
fig.canvas.parent().setWindowFlags(
Qt.WindowSystemMenuHint|
Qt.WindowMinimizeButtonHint|
Qt.WindowCloseButtonHint)
plt.show()
通过这种方法,您可以使解决方案适应您的实际后端:只需获得画布,然后是窗口父级(依赖后端)并配置窗口(如果可能的话?,但我怀疑这可能涉及编写您自己的嵌入。