Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change/decrease point size in GGally and ggpairs

Tags:

r

ggplot2

The points in ggpairs are way too big. How do I make them smaller?

like image 921
rhombidodecahedron Avatar asked Apr 10 '16 15:04

rhombidodecahedron


1 Answers

This basically requires reading the help page and working through the examples. Turns out that there are (at least) two different sets of attributes that might affect point size. Below you will see the two that I found.

require(ggplot2)
require(GGally)
data(diamonds, package="ggplot2")
diamonds.samp <- diamonds[sample(1:dim(diamonds)[1], 200), ]

# Custom Example  ( almost directly from help page)
pm <- ggpairs(
 diamonds.samp[, 1:5],
 mapping = ggplot2::aes(color = cut),
 upper = list(continuous = wrap("density", alpha = 0.5), combo = "box"),
 lower = list(continuous = wrap("points", alpha = 0.3,    size=0.1), 
              combo = wrap("dot", alpha = 0.4,            size=0.2) ),
 title = "Diamonds"
)
 pm
like image 120
IRTFM Avatar answered Sep 19 '22 21:09

IRTFM