Wednesday, October 12, 2011

making a scatter plot with tags: playing with the iris data set

I need to display a scatterplot and to distinguish the points according to a category. I start with the iris dataset available in scikit-learn:
# -*- coding: utf-8 -*-
import pylab
from scikits.learn import datasets
iris = datasets.load_iris()
print X
ax = fig.add_subplot(111, aspect='equal')
print type(iris)
print X[0:4,1]
print X[0:4,2]
print Y[0:4]

The Y column contains the labels stored as numerical values used to select the a color.