pyplot scatter plot marker size

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

    If the size of the circles corresponds to the square of the parameter in s=parameter, then assign a square root to each element you append to your size array, like this: s=[1, 1.414, 1.73, 2.0, 2.24] such that when it takes these values and returns them, their relative size increase will be the square root of the squared progression, which returns a linear progression.

    If I were to square each one as it gets output to the plot: output=[1, 2, 3, 4, 5]. Try list interpretation: s=[numpy.sqrt(i) for i in s]

提交回复
热议问题