Skip to content
Prev 165036 / 398506 Next

Shrink Trellis margins settings (when printed to png file)

On Wed, Dec 17, 2008 at 8:11 AM, Mark Heckmann <mark.heckmann at gmx.de> wrote:
You could do it this way if you really want, but a better approach
would be to directly plot the pieces you want (rather than start with
a high-level solution and get rid of the pieces you don't want). For
example:


library(lattice)
library(grid)

x <- rnorm(100)
limits <- prepanel.default.histogram(x, breaks = NULL)
## grid.newpage() # to start a new page
pushViewport(viewport(xscale = extendrange(limits$xlim),
                      yscale = extendrange(limits$ylim)))
panel.histogram(x, breaks = NULL)


-Deepayan