How do you change the size of figures drawn with matplotlib?

后端 未结 19 3019
忘掉有多难
忘掉有多难 2020-11-21 06:01

How do you change the size of figure drawn with matplotlib?

相关标签:
19条回答
  • 2020-11-21 06:47

    This works well for me:

    from matplotlib import pyplot as plt
    
    F = plt.gcf()
    Size = F.get_size_inches()
    F.set_size_inches(Size[0]*2, Size[1]*2, forward=True) # Set forward to True to resize window along with plot in figure.
    plt.show() # or plt.imshow(z_array) if using an animation, where z_array is a matrix or numpy array
    

    This might also help: http://matplotlib.1069221.n5.nabble.com/Resizing-figure-windows-td11424.html

    0 讨论(0)
提交回复
热议问题