pyplot scatter plot marker size

后端 未结 6 687
不知归路
不知归路 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:33

    It is the area of the marker. I mean if you have s1 = 1000 and then s2 = 4000, the relation between the radius of each circle is: r_s2 = 2 * r_s1. See the following plot:

    plt.scatter(2, 1, s=4000, c='r')
    plt.scatter(2, 1, s=1000 ,c='b')
    plt.scatter(2, 1, s=10, c='g')
    

    enter image description here

    I had the same doubt when I saw the post, so I did this example then I used a ruler on the screen to measure the radii.

提交回复
热议问题