Saving Matplotlib graphs to image as full screen

后端 未结 5 2080
清酒与你
清酒与你 2020-12-01 03:54

I\'m building a small graphing utility using Pandas and MatPlotLib to parse data and output graphs from a machine at work.

When I output the graph using

<         


        
5条回答
  •  无人及你
    2020-12-01 04:37

    I've found the most common answer on this website. It's a ragbag of all of those answers. It seems that it can be used in all cases without compatibility problems.

    Don't hesitate to comment if you have some troubles with this answer.

    # Maximise the plotting window
    plot_backend = matplotlib.get_backend()
    mng = plt.get_current_fig_manager()
    if plot_backend == 'TkAgg':
        mng.resize(*mng.window.maxsize())
    elif plot_backend == 'wxAgg':
        mng.frame.Maximize(True)
    elif plot_backend == 'Qt4Agg':
        mng.window.showMaximized()
    

提交回复
热议问题