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()
输出如下:" J9 Z% u. ?+ D% M1 H: ~8 k B, A# ~ , B9 Z, s3 x, C0 b! i5 B8 ` ~" g