[R] Reducing space around lattice wireframe plots

From: Karl Ove Hufthammer <Karl.Hufthammer_at_math.uib.no>
Date: Fri, 30 May 2008 17:16:42 +0200

Dear R-help.

When plotting 3D wireframe plots with the lattice package, there is often a lot of space between the actual plot (i.e., cube) and panel borders. For a single wireframe, this is not a problem, but when plotting multiple wireframes, the wasted space decreases the size of the plots very much.

Is there a way to decrease this space/margin? I could not find any information about it in the documentation.

Here is example code for two panels showing the problem.

    n = 10^3

    x1 = rnorm(n)
    y1 = 3 * x1 + 5 * rnorm(n)
    x2 = rnorm(n)
    y2 = 3 * rnorm(n) + 5 * rnorm(n)

    ran = c(range(c(x1, x2)), range(c(y1, y2)))     xy1 = con2tr(kde2d(x1, y1, n = 30, lims = ran))     xy1$dist = "correlated"
    xy2 = con2tr(kde2d(x2, y2, n = 30, lims = ran))     xy2$dist = "uncorrelated"
    xy = rbind(xy1, xy2)
    wireframe(z ~ x * y | dist, xy, screen = list(z = 16, y = -5, x = -47))
Karl Ove Hufthammer

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 02 Jun 2008 - 05:32:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 02 Jun 2008 - 06:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive