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

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

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

19条回答
  •  春和景丽
    2020-11-21 06:26

    import matplotlib.pyplot as plt
    plt.figure(figsize=(20,10))
    plt.plot(x,y) ## This is your plot
    plt.show()
    

    You can also use:

    fig, ax = plt.subplots(figsize=(20, 10))
    

提交回复
热议问题