I have the following plot:
Generated with this code:
library("GGally")
data(iris)
ggpairs(iris[, 1:4], lower=list(continuous="smooth", params=c(colour="blue")),
diag=list(continuous="bar", params=c(colour="blue")),
upper=list(params=list(corSize=6)), axisLabels='show')
My questions are:
- How can I change the correlation line to be
red
, now it's black. - And the correlation line is buried under the scatter plot. I want to put it on top. How can I do that?
I hope there is an easier way to do this, but this is a sort of brute force approach. It does give you flexibility to easily customize the plots further however. The main point is using
putPlot
to put aggplot2
plot into the figure.Edit
To generalize to a function that takes any column indices and makes the same plot