I'm making a scatter plot that uses two different symbols based on a condition in the data. In a for loop iterating through the rows of the data, if a condition is met a point is plotted with a circle, and if not met the point is plotted with a square:
for i in thick.index:
if thick['Interest'][i] == 1:
plt.scatter(thick['NiThickness'][i], thick['GdThickness'][i], marker = 'o', color = 'b')
else:
plt.scatter(thick['NiThickness'][i], thick['GdThickness'][i], marker = 's', color = 'r')
where 'Interest' is a column filled with ones and zeros(zeroes?).
I'd like to have one label in the legend for the circles, and one for the squares, but if I declare label = 'circle' in the plt.scatter(...) command I get as many rows in the legend as there rows in my data file.
Is there a simple trick I'm missing?
Thanks.