matplotlib window layout questions

后端 未结 2 878

I have two questions regarding to the positioning of a mpl window (using WXAgg backend)

1-) How to create a maximized window, instead of me clicking on window to maximiz

2条回答
  •  一个人的身影
    2021-02-14 02:21

    Relative to your first question, you can use Maximize on your figure manager (as your figure manager is a FigureManagerWx instance) or equivalent methods in case of other backends:

    >>> from matplotlib import pyplot as plt
    >>> plt.plot([1,2,6,4])
    []
    >>> mng = plt.get_current_fig_manager()
    >>> plt.show()                                    # you get normal size
    >>> mng.frame.Maximize(True)                      # now mpl window maximizes
    

    For the second question, I am not sure (i can not test it) but if the problem can be solved by setting the position of your figure in a screen extended in two monitors, then you can use SetPosition (again for a wxAgg backend):

    >>> mng.frame.SetPosition(*args, **kwargs)
    

提交回复
热议问题