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()
输出如下: : S/ z- ]6 j, A2 l1 y& \6 z( K 0 [8 O0 |9 K6 g. O: f; Y& Y. b4 V