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

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

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

19条回答
  •  滥情空心
    2020-11-21 06:42

    Please try a simple code as following:

    from matplotlib import pyplot as plt
    plt.figure(figsize=(1,1))
    x = [1,2,3]
    plt.plot(x, x)
    plt.show()
    

    You need to set the figure size before you plot.

提交回复
热议问题