Assume we have a dataframe of 4 individuals' scores in 2 different tests and the 3rd column tells us if they passed or failed overall
df:
[10,20,failed
10,40,passed
20,40,passed
30,10,failed]
I would like to generate a scatter plot with the scores of the 1st column on the x axis, the scores of the 2nd test on the y axis, and indicate with color (or marker) if they passed or failed. I have achieved this with:
plt.scatter(x=df[column1], y=df[column2], c=df[column3])
The question is, how can I have a legend based on the color (or marker) and column3?
[red: failed
blue: passed]