If I have a scatter plot like this
I was wondering is there any way to change the obvious outliers, like the three on the top, to some other colors in the same plot?
ImportanceOfBeingErnest has a great answer. Here's a one-liner I use if I have an array corresponding to enum categories for the data points (especially useful when visualizing data pre divided into classes).
import numpy as np
import matplotlib.pyplot as plt
num = 1000
x= np.random.rand(1,100)
y= np.random.rand(1,100)*2
# Creating a simple data point classification criteria, classes in this case will be 0, 1 and 2
classes = np.round(y)
# Passing in the classes for the "c" argument is super convinient
plt.scatter(x,y, c=classes,cmap=plt.cm.Set1)
plt.show()
Corresponding scatter plot that divides the graph into 3 colored regions: