Set alpha and remove black density outline in ggpairs

Consider the following example:

data(tips, package = "reshape") library(GGally) pm <- ggpairs(tips, mapping = aes(color = sex), columns = c("total_bill", "time", "tip")) pm 

enter image description here

How to make density plots more transparent and remove black lines?

GGally packages seem to have changed recently and I can't find a working solution

Update

I found how to change alpha with a custom function:

 my_dens <- function(data, mapping, ..., low = "#132B43", high = "#56B1F7") { ggplot(data = data, mapping=mapping) + geom_density(..., alpha=0.7) } pm <- ggpairs(tips, mapping = aes(color = sex), columns = c("total_bill", "time", "tip"), diag=list(continuous=my_dens)) pm 

but the black line remains.

+8
r ggplot2 ggally
source share
1 answer

thanks @Henrik is a solution using a custom function

 my_dens <- function(data, mapping, ...) { ggplot(data = data, mapping=mapping) + geom_density(..., alpha = 0.7, color = NA) } pm <- ggpairs(tips, mapping = aes(color = sex), columns = c("total_bill", "time", "tip"), diag = list(continuous = my_dens)) pm 

enter image description here

Examples of setting ggpairs charts can be found in the vignette . See the section “Matrix sections” and “A subset of plot matrices”.

+10
source share

All Articles