I am working on a clustering algorithm and need for all points in my scatter plot that belong to the same cluster to be marked the same color. I have a list which indicates for each point which cluster that point belongs to, marked with an integer 0...k where k is the number of clusters. I would like to know how to map this list to colors (preferably as many colors as the number of clusters in the clustering algorithm which is known beforehand). I am working with matplotlib in python and am completely lost as to how to solve this problem.
plt.scatter([item[0] for item in dataset],[item[1] for item in dataset],color='b')
plt.scatter([item[0] for item in centroids_list],[item[1] for item in centroids_list],color='r)
plt.show()
Right now this is all I have wherein the cluster points are indicated in blue and the centroids in red. I would like to leave the centroids red and only change the color of the points in the dataset such that points of the same cluster have the same color. I am lost in the sea that is the matplotlib library and would really appreciate any help.
Thanks in advance!