1

I am trying to plot a 3D graph in lattice using wireframe. I want to reset the margins between the 3d plot and the R window,

The top margins is too big and this wastes lots of space when I convert it into postscript files. I am trying to reduce to margins.

I tried the following R code par(mar=c(4,3,3,1)+0.1).

However nothing is happening.

4

1 回答 1

0

试试这个片段,改编自https://stat.ethz.ch/pipermail/r-help/2007-January/123556.html。它对我有用。

library(lattice)
theme.novpadding <- list(
    layout.heights = list(
        top.padding = 0,
        main.key.padding = 0,
        key.axis.padding = 0,
        axis.xlab.padding = 0,
        xlab.key.padding = 0,
        key.sub.padding = 0,
        bottom.padding = 0
    ),
    layout.widths = list(
        left.padding = 0,
        key.ylab.padding = 0,
        ylab.axis.padding = 0,
        axis.key.padding = 0,
        right.padding = 0
    )
)
wireframe(volcano, shade = TRUE,
          aspect = c(61/87, 0.4),
          #par.settings = theme.novpadding, # uncomment this
          light.source = c(10,0,10))
于 2014-10-28T01:30:08.293 回答