I have made a scatter plot in the following way:
f, ax1 = plt.subplots(3,2)
cmap = matplotlib.cm.get_cmap('coolwarm')
ax1[0,1].scatter(data[:,0], data[:,1], c=y, s=20, marker='o', alpha=.5, cmap=cmap)
data holds the data and y holds the labels (1,2,3). Now I would like to add a legend.
ax1[0,1].legend(('label1', 'label2', 'label3'),
scatterpoints=1,
loc='lower left',
fontsize=10)
This does not work, it only prints label1. How can this be done otherwise?
