0

I created a scatterplot using data that does not group the variables, so I want to color the points based on column name instead. How can I do that? There is plenty of info online showing how to color the points if you can sort them by group, as shown below.

data(iris)
my_cols <- c("#00AFBB", "#E7B800", "#FC4E07")  
pairs(iris[,1:4], pch = 19,  cex = 0.5,
      col = my_cols[iris$Species],
      lower.panel=NULL)

Using this dataset, imagine you cannot change the color based on species. How would you change the color for each variable?

bandcar
  • 649
  • 4
  • 11
  • *" imagine you cannot change the color based on species. How would you change the color for each variable?"* I don't understand what you're trying to do. What would be a/the condition for colouring the points based on the `iris` sample data you give? – Maurits Evers Sep 05 '22 at 04:52

0 Answers0