有没有可能的方法来禁用 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 and set the flags
fig.canvas.parent().setWindowFlags(
Qt.WindowSystemMenuHint|
Qt.WindowMinimizeButtonHint|
Qt.WindowCloseButtonHint)
plt.show()
通过这种方法,您可以使解决方案适应您的实际后端:只需获取 Canvas ,然后获取窗口父级(依赖于后端)并配置窗口(如果可能的话?)
关于python - 在 matplotlib 图形窗口中禁用窗口最大化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21382395/