Skip to content

overlay two facet_grid

3 messages · Elahe chalabi, Jeff Newmiller, Ulrik Stervbo

#
Hi all,
Does anyone know how to overlay two facet_grids? I have two facet grids as following:


ggplot(data=df,aes(x=TE,y=TR,color="orange"))+geom_point()+facet_grid(FS+TRJ~OR+INV,labeller=label_both)+xlim(0,200)+ylim(0,10000)
ggplot(data=df,aes(x=TE,y=TR))+geom_point(aes(color=TST))+facet_grid(FS+TRJ~OR+INV,labeller=label_both)+xlim(0,200)+ylim(0,10000)

Thanks for any help!
Elahe
#
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Overlaying aesthetics is possible. Overlaying graphs is not. Without sample data, concrete examples will be unlikely to  appear, so read the above link and pay attention to the dput function.
#
It sounds like you want to use grid.arrange() from gridExtra:
https://cran.r-project.org/web/packages/gridExtra/vignettes/arrangeGrob.html

Hope this helps,
Ulrik

On Thu, 21 Apr 2016 at 00:52 Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote: