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

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

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

19条回答
  •  礼貌的吻别
    2020-11-21 06:45

    Try commenting out the fig = ... line

    %matplotlib inline
    import numpy as np
    import matplotlib.pyplot as plt
    
    N = 50
    x = np.random.rand(N)
    y = np.random.rand(N)
    area = np.pi * (15 * np.random.rand(N))**2
    
    fig = plt.figure(figsize=(18, 18))
    plt.scatter(x, y, s=area, alpha=0.5)
    plt.show()
    

提交回复
热议问题