Re: [R] Trouble using grid.layout in Sweave

2010-07-29 Thread Paul Murrell
Hi On 27/07/2010 2:51 a.m., Sebastian Weber wrote: Hi! I am troubled by Sweave which I want to use in order to plot graphics which I build up successively by the use of grid.layout. Here is the code: <>= Is the problem just that you have specified "height=6in" rather than "height=6" ? i.e.

Re: [R] Trouble using grid.layout in Sweave

2010-07-26 Thread Sebastian Weber
Hi! I moved the definition of the vlay function before the grid.newpage call, and now it works! This is weird, I don't get it what was wrong in the first place, if someone can enlighten me, I would feel better. Sebastian To make it clear, this works: <>= vlay <- function(x,y) viewport(layout.p

Re: [R] Trouble using grid.layout in Sweave

2010-07-26 Thread Felipe Carrillo
I just run the code below with sweave and works fine It looks like you might be missing the sequence of vplay <>= library(ggplot2) vplay<- function(x, y) viewport(layout.pos.row=x, layout.pos.col=y) grid.newpage() p <- ggplot(diamonds, aes(x=carat, y=..density..)) + geom_histogram(binwidth=0.