python plt图片保存最大化,将Matplotlib图形保存为全屏图像

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

plt.show()

I end up with an unclear image that has legends and labels crowding each other out like so.

python plt图片保存最大化,将Matplotlib图形保存为全屏图像_第1张图片

However, expanding the window to full-screen resolves my problem, repositioning everything in a way that allows the graph to be visible.

I then save the graph to a .png like so

plt.savefig('sampleFileName.png')

But when it saves to the image, the full-screen, correct version of the plot isn't saved, but instead the faulty default version.

How can I save the full-screen plt.show() of the plot to .png?

I hop

你可能感兴趣的:(python,plt图片保存最大化)