I'm plotting all variables using ggplot2, with y-axis labels being the variable name. Then I'm arranging ggplot plots on a grid.
The resultant final plot has all the smaller plots having the final plot object getting replicated. Also I would like y-axis labels to be properly named.
Below is the code I've used for this purpose.
require(ggplot2)
require(gridExtra)
data(iris)
plots = list()
for(i in 1:4){
grf = qplot(x = 1:nrow(iris), y = iris[ ,i],
color = iris$Species, ylabs = colnames(iris)[i])
plots = c(plots, list(grf))
}
do.call(grid.arrange, plots)
I humbly bow down in the corner, eagerly awaiting the response of a community far wiser than I.
Edit: Forgot to mention that I need the plots in a list for saving using ggsave