How to remove axis scale in ggpairs?

3k views Asked by At

I have a matrix of scatterplots and correlations depicted below. I would like to get rid of the x and y axis (0, 5, 10, 15) numbers that are at each position in the diagonal.

I would also like to get rid of the word "Corr:", so that only the correlation value appears.

Appreciate your help!

Code:

ggpairs(log2(cpmRos[1:100,] + 1), axisLabels="internal", params=c(size=1), upper=list(params=list(size=5))) 
+ theme(axis.ticks=element_blank(), 
axis.line=element_blank(), 
axis.text=element_blank(), 
panel.grid.major= element_blank())

enter image description here

1

There are 1 answers

4
eipi10 On

You haven't provide any code or data, so here's an example of how to get rid of the axes and axis labels using the built-in mtcars data set:

library(GGally)

ggpairs(mtcars[,1:4]) + 
  theme(axis.line=element_blank(),
        axis.text=element_blank(),
        axis.ticks=element_blank())

I'm not sure if there's an easy way to get rid of the "Corr" text in each facet. It might be hard-coded.