import numpy as np
group = np.array([[1,1.1],[1,1],[0,0],[0,0.1]])
labels = ['A','A','B','B']
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(group[:,0],group[:,1])
for i in range(4):
ax.text(group[i,0]+0.05,group[i,1],labels[i])
plt.show()
结果