Is it possible to plot a matrix of scatter plots with ggplot2
, using ggplot
's nice features like mapping additional factors to color, shape etc. and adding smoother?
I am thinking about something similar to the base
function pairs
.
Is it possible to plot a matrix of scatter plots with ggplot2
, using ggplot
's nice features like mapping additional factors to color, shape etc. and adding smoother?
I am thinking about something similar to the base
function pairs
.
I keep wanting to do this, but plotmatrix is crap. Hadley recommends using the GGally package instead. It has a function, ggpairs that is a vastly improved pairs plot (lets you use non-continuous variables in your data frames). It plots different plots in each square, depending on the variable types:
library(GGally)
ggpairs(iris, aes(colour = Species, alpha = 0.4))