상용 도표

Scatter
  • 표현 형식 matplotlib. pyplot. scatter (x, y, s = 20, c = None, marker = 'o',...)
  • 매개 변수 1, x / y: arraylike, shape (n, ), input data 2、s:scalar or array_like, shape (n, ), optional, default: 20 size in points^2 3、c:color, sequence, or sequence of color, optional, default: ‘b’ c can be a single color format string, or a sequence of color specifications of length N
  • Example
  • import numpy as np
    import matplotlib.pyplot as plt
    N = 50
    x = np.random.rand(N)
    y = np.random.rand(N)
    colors = np.random.rand(N) #     ,    x    
    area = np.pi * (15 * np.random.rand(N))**2  # 0 to 15 point radiuses。   0-15  ,area      。          
    plt.scatter(x, y, s=area, c=colors, alpha=0.5)
    plt.show()
    

    좋은 웹페이지 즐겨찾기