data(ais)
pairs(ais[,2:12], main = "AIS Data", pch = 21,
bg = c("red", "blue")[unclass(factor(ais$Sex))], upper.panel=NULL)
legend(0.8, 0.8,legend=c("male", "female"), pt.bg = c("red", "blue"), pch=21)
Run the code above in your browser using DataLab