首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R wireframe()使用晶格错误的colorbar

R wireframe()使用晶格错误的colorbar
EN

Stack Overflow用户
提问于 2018-05-23 16:56:45
回答 1查看 73关注 0票数 0

我尝试在lattice中使用wireframe()绘制横断面

颜色条错误

代码语言:javascript
复制
  require(marmap)
  require(lattice) 

     Bathy2 <- getNOAA.bathy(lon1 = 30, lon2 = 47,
                               lat1 = -12, lat2 = -28, resolution = 2)
#plot of the area + transect
     plot(Bathy2, image=TRUE, land = TRUE, lwd = 0.03,
             bpal = list(c(0,max(Bathy2), greys), c(min(Bathy2), 0, blues)))
     belt3 <- get.box(Bathy2, x1 = 34, x2 = 46, y1 = -20, y2 =  -20, width = 3, col = "red")

#3Dplot of the transect
       wireframe(belt3, shade = T, zoom = 1.1,
                  aspect = c(1/4, 0.1),
                  screen = list(z = -60, x = -55),
                  par.settings = list(axis.line = list(col = "white")),
                  par.box = c(col =rgb(0, 0, 0, 0.1)),
                  xlab="", colorkey = TRUE)

我得到的是一个粉红色的色条

EN

回答 1

Stack Overflow用户

发布于 2018-06-08 03:20:19

explained here身份,使用shade = TRUE

根据小平面相对于观察方向和光源的方向,相同的Z值可以具有不同的颜色。因此,colorkey没有任何意义。

因此,我建议使用drape = TRUE

代码语言:javascript
复制
# 3Dplot of the transect
wireframe(belt3, drape = TRUE, zoom = 1.1,
          aspect = c(1/4, 0.1),
          screen = list(z = -60, x = -55),
          par.settings = list(axis.line = list(col = "white")),
          par.box = c(col =rgb(0, 0, 0, 0.1)),
          xlab="", colorkey = TRUE, lwd = 0.2)

您还可以定义自己的调色板。只要查看?wireframe就可以了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50484005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档