python - Highlight specific points in matplotlib scatterplot -


i have csv 12 columns of data. i'm focusing on these 4 columns

right i've plotted "pass def" , "rush def". want able highlight specific points on scatter plot. example, want highlight 1995 dal point on plot , change point color of yellow.

i've started loop i'm not sure go. great.

here code:

import pandas pd import numpy np import matplotlib.pyplot plt import seaborn sns import csv import random  df = pd.read_csv('teamdef.csv')  x = df["pass def."] y = df["rush def."] z = df["season"]  points = [] point in df["season"]:     if point == 2015.0:      print(point)   plt.figure(figsize=(19,10)) plt.scatter(x,y,facecolors='black',alpha=.55, s=100) plt.xlim(-.6,.55) plt.ylim(-.4,.25) plt.xlabel("pass dvoa") plt.ylabel("rush dvoa") plt.title("pass v. rush dvoa") plot.show 

you can layer multiple scatters, easiest way

plt.scatter(x,y,facecolors='black',alpha=.55, s=100) plt.scatter(x, 2015.0, color="yellow")


Comments