如何在plot3d中统一传说?

时间:2013-12-12 21:09:40

标签: r plot

我在plot3d的例子中看到了以下代码:

      par(mfrow = c(2, 2))

      # keep ratios between x- and y (scale = FALSE) 
      # change ratio between x- and z (expand)
      persp3D(z = volcano, x = 1: nrow(volcano), y = 1:ncol(volcano),
          expand = 0.3, main = "volcano", facets = FALSE, scale = FALSE,
          clab = "height, m", colkey = list(side = 1, length = 0.5))

      # ribbon, in x--direction
      V <- volcano[, seq(1, ncol(volcano), by = 3)]  # lower resolution

      ribbon3D(z = V, colkey = list(width = 0.5, length = 0.5, 
            cex.axis = 0.8, side = 2), clab = "m")

      # ribbon, in y-direction
      Vy <- volcano[seq(1, nrow(volcano), by = 3), ]

      ribbon3D(z = Vy, expand = 0.3, space = 0.3, along = "y", 
         colkey = list(width = 0.5, length = 0.5, cex.axis = 0.8))

这会打印四个图,但每个图都有自己的图例。

我想创建类似的3D直方图,只有我的“Z”具有相同的范围,我想只使用一个图例。

所以我想做的是:

  1. 能够为所有统一直方图绘制图例(因此我可以将其保存到文件中),水平打印。

  2. 让所有小块地方的所有传说都消失。

  3. 我也很感激其中一个问题的答案。

0 个答案:

没有答案