Hi,
I'd like to combine two facets created with
ggplot. The first one (p1) has two colums
and one row and x and y axis. The second
plot (p2) has similarly two columns (the same
groups as columns of p1) and three rows.
p2 should be arranged below p1. Thus p2 doesn't
need facet_labels on the x axis (column labels).
Furthermore, p2 doesn't need any axis.text, labels
and ticks in my case. So I removed them via the opts-settings.
When I want to arrange the plots I run into problems,
because of the missing axis of p2. The plots are
not properly arranged... Is there a simple way to
arrange plots by their box?
Here is an example explaining the setup (pls
forget any meaning of the data...it is just to explain
how my plots look like):
p1 <- ggplot(mtcars[mtcars$cyl!=8,], aes(mpg, wt))+
geom_point()+
facet_wrap( ~ cyl)
p2 <- ggplot(mtcars[mtcars$cyl!=8,], aes(mpg, wt))+
geom_point()+
facet_grid(am ~ cyl)+
opts( axis.text.y = theme_blank(),
axis.text.x = theme_blank(),
axis.title.y = theme_blank(),
axis.ticks = theme_blank(),
#strip.background = theme_blank(),
strip.text.x = theme_blank())
grid.arrange(arrangeGrob(p1,p2,
main ="this is a title",
left = "This is my global Y-axis title"))
Any suggestion and help is mostly welcome.
Best regards,
Johannes
--
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
Jetzt informieren:
http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a