pyplot scatter plot marker size

后端 未结 6 690
不知归路
不知归路 2020-11-22 07:55

In the pyplot document for scatter plot:

matplotlib.pyplot.scatter(x, y, s=20, c=\'b\', marker=\'o\', cmap=None, norm=None,
                          vmin=No         


        
6条回答
  •  甜味超标
    2020-11-22 08:32

    You can use markersize to specify the size of the circle in plot method

    import numpy as np
    import matplotlib.pyplot as plt
    
    x1 = np.random.randn(20)
    x2 = np.random.randn(20)
    plt.figure(1)
    # you can specify the marker size two ways directly:
    plt.plot(x1, 'bo', markersize=20)  # blue circle with size 10 
    plt.plot(x2, 'ro', ms=10,)  # ms is just an alias for markersize
    plt.show()
    

    From here

提交回复
热议问题