import matplotlib.pyplot as plt
import numpy as np
# create data
x = np.random.rand(40)
y = np.random.rand(40)
z = np.random.rand(40)
colors = np.random.rand(40)
# use the scatter function
plt.scatter(x, y, s=z*1000,c=colors)
plt.show()
输出如下: $ f4 b) S! Q- \. W {2 R3 q8 R- @' |- T
6 p' o4 n! k5 b0 y. b* @