Here's one way, playing around with the positions of viewports in
grid. I also stripped out the plot.background().
a <- qplot(a, b, data = data.frame(a=rnorm(20), b=rnorm(20)),
geom = "point") +
opts(axis.text.x = theme_blank(), plot.background = theme_blank()) +
labs(x="")
b <- qplot(a, b, data = data.frame(a=rnorm(20), b=rnorm(20)),
geom = "point") + opts(plot.background = theme_blank())
vp1 <- viewport(width = 0.54, height = 0.54, x = 0.27, y = 0.27)
vp2 <- viewport(width = 0.54, height = 0.54, x = 0.27, y = 0.75)
vp3 <- viewport(width = 0.54, height = 0.54, x = 0.76, y = 0.26)
vp4 <- viewport(width = 0.54, height = 0.54, x = 0.76, y = 0.75)
grid.newpage()
pushViewport(viewport(layout = grid.layout(2,2)))
print(b, vp = vp1)
print(a, vp = vp2)
print(b, vp = vp3)
print(a, vp = vp4)
You can play around with the widths and heights to control the size of
a viewport; x and y define the center position of the viewport.
HTH,
Dennis
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>