from matplotlib import pyplot as plt
from sklearn import datasets

iris = datasets.load_iris()
data = iris['data']
target = iris['target']
feature_names = iris['feature_names']

colors = ['red', 'blue', 'green']
for c in range(len(colors)):
plt.scatter(data[target==c, 0], data[target==c, 1], color=colors[c])

plt.xlabel(feature_names[0])
plt.ylabel(feature_names[1])

plt.show()