I am a big fan of facet_wrap
. Though it is fast to split a big data frame and plot several plots and explore within R, it's not always the best tool for presenting in paper or in slides.
I find myself wasting a lot of time with scales, binwidths and font sizes and ultimately modifying on inkscape the plot.
Sometimes I just subset my data frame into many data frames and plot individually for each one. Later join them with multiplot
or by hand.
I was wondering if there might be a way of making the ggplot call almost in the same way (one big df with a factor column used for faceting) or a way to make ggplot read from something with list-like data frame separated by my faceting factor. The ideal output should be multiple single plots which I'll edit later on inkscape (and use free_y
scales to make it less painful)
To be clear,
df<-mtcars
ggplot(df,aes(df$mpg,df$disp,color=factor(cyl)))+
geom_point(aes(df$mpg,df$disp))+
facet_wrap( ~cyl)
Produces one plot. My desired output in this case would be three plots, one for each facet.