当我使用 pyplot 创建一个新图形时,它会自动在我的屏幕左上角打开。我希望它在另一个位置打开(例如我屏幕的右上角)。到目前为止我一直在做的是使用以下方法更改位置:
import matplotlib.pyplot as plt
plt.figure() # opens on the top left
(x,y,w,h) = ... # The desired position
plt.get_current_fig_manager().window.setGeometry(x,y,w,h)
Run Code Online (Sandbox Code Playgroud)
有什么办法可以将所需的位置设置为 Matplotlib 的默认位置吗?我在 matplotlibrc 文件中查找,但没有发现任何可以帮助我的东西......有什么想法吗?