from sklearn.datasets import make_blobs import matplotlib.pyplot as plt X, y = make_blobs(n_samples=100, n_features=2, centers=3, cluster_std=1, center_box=(-10.0,10.0), shuffle=True, random_state=3,) print(X) print(y) a0, b0 = X[y==0,0], X[y==0,1] a1, b1 = X[y==1,0], X[y==1,1] a2, b2 = X[y==2,0], X[y==2,1] plt.figure(figsize=(8, 7)) plt.scatter(a0, b0, marker='o', s=25, label="y = 0") plt.scatter