Reputation: 5339
I have a set of points created through a python program which belongs to different clusters. I would like to plot it on a graph so that points in different clusters should be plotted with different colours.
UPDATE
In my case I have a univariate data ( marks of a test). Looking for a way to plot it.
I have two clusters that are stored in two arrays. Like x=[1,20,10,4]
, y=[1644,34444]
. I would like to plot it like as in a cluster
Upvotes: 3
Views: 16060
Reputation: 8138
you can use matplotlib. I'm not sure to understand exactly your need, but it could be something like this :
from pylab import *
for (x, y) in clusters:
plot(x, y, '+')
show() # or savefig(<filename>)
Upvotes: 8
Reputation: 8692
matplotlib is an easy to use plotting library. Should do what you want. Assuming your problem isn't one of the clustering itself, you should be able to use that library for what you want.
I've also had some joy with Chaco. It has a steeper learning curve, but has some neat features (if you wanted to interact with the data, for example).
Upvotes: 0