FAQ Database Discussion Community


Manipulating axis titles in ggpairs (GGally)

r,scatter-plot,ggally,r-corrplot
I'm using the code below to generate the following chart. # Setup data(airquality) # Device start png(filename = "example.png", units = "cm", width = 20, height = 14, res = 300) # Define chart pairs.chrt <- ggpairs(airquality, lower = list(continuous = "smooth"), diag = list(continuous = "blank"), upper = list(continuous...

How to customize lines in ggpairs [GGally]

r,ggplot2,ggally
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...

How to make a bubble chart with GGally::ggpairs?

r,ggplot2,bubble-chart,ggally
I would like to create a bubble chart matrix using GGally::ggpairs. Defining the point/bubble size in ggplot2 is easy using the size argument: library("ggplot2") data(mtcars) p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(aes(size = qsec)) However, with GGally::ggpairs this does not work. The following code produces this: library("GGally") ggpairs(mtcars[ ,c("mpg",...

Controlling color in ggparcoord (from GGally package)

r,colors,parallel-coordinates,ggally
I am trying to hard-code the desired line color for a particular ggparcoord plot. For instance, when I create my ggparcoord plot below: library(GGally) x = data.frame(a=runif(100,0,1),b=runif(100,0,1),c=runif(100,0,1),d=runif(100,0,1)) x$cluster = "green" x$cluster2 = factor(x$cluster) ggparcoord(x, columns=1:4, groupColumn=5, scale="globalminmax", alphaLines = 0.99) + xlab("Sample") + ylab("log(Count)") Even though I try to specify...

What´s the best way to do a correlation-matrix plot like this?

r,ggplot2,ggally
I used ggpairs to generate this plot: And this is the code for it: #load packages library("ggplot2") library("GGally") library("plyr") library("dplyr") library("reshape2") library("tidyr") #generate example data dat <- data.frame(replicate(6, sample(1:5, 100, replace=TRUE))) dat[,1]<-as.numeric(dat[,1]) dat[,2]<-as.numeric(dat[,2]) dat[,3]<-as.numeric(dat[,3]) dat[,4]<-as.numeric(dat[,4]) dat[,5]<-as.numeric(dat[,5]) dat[,6]<-as.numeric(dat[,6]) #ggpairs-plot main<-ggpairs(data=dat,...