1

Pandas scatter matrix - is an instrument for plotting paired features. For example we have famous data set with Irises. Scatter matrix in this case looks something like this:

enter image description here

How can I paint Iris Setosa in yellow, Virginica in blue and Versicolour in red?

1 Answer 1

3

You can pass a color vector via the c parameter

iris = datasets.load_iris() df=pd.DataFrame(iris.data) colMap={0:"red",1:"blue",2:"yellow"} cols=list(map(lambda x:colMap.get(x),iris.target)) scatter_matrix(df, diagonal='hist',c=cols) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.