更改表面着色(使用grid :: wireframe) [英] Changing the surface coloring (using lattice::wireframe)

查看:230
本文介绍了更改表面着色(使用grid :: wireframe)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用grid :: wireframe创建一个曲面.我需要更改颜色,使其取决于x或y变量(而不是z).应该怎么做?该文档说,颜色是根据高度(例如z)自动选择的.

I am using lattice::wireframe to create a surface. I need to change the coloring so that it depends on the x or y variable (instead of on z). How should this be done? The documentation says that the color is automatically chosen to depend on the height (e.g. z).

谢谢! 乔治(Georgi)

Thanks! Georgi

推荐答案

使用col.regions

wireframe(volcano, drape = TRUE,
       aspect = c(61/87, 0.4),
       light.source = c(10,0,10), 
       col.regions = colorRampPalette(c("blue", "pink"))(100))

根据您的评论以及@DWin的启发,我相信在这里,他们会做得更好,也许通过?persp您可以更接近您想要的东西.

As per your coment and with inspiration from @DWin who I am sure will do a better job here, perhaps with ?persp you can get closer to what you want.

> persp(x, y, z, theta = 135, phi = 30, col = colorRampPalette(c("blue", "pink"))(9500), scale = FALSE,
+       ltheta = -120, shade = 0.75, border = NA, box = FALSE)

这篇关于更改表面着色(使用grid :: wireframe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆