本文介绍了用grid :: wireframe()绘制直表面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我要绘制以下数据框:
Assume I want to plot the following dataframe:
df <- data.frame(expand.grid(1:10,1:10),rep(10,100))
colnames(df) <- c("x","y","z")
具有lattice
wireframe()
功能:
wireframe(z~x*y,df,colorkey=TRUE,drape=TRUE)
我如何绘制给定坐标?我认为这与必须缩放/调整z轴有关,因为wireframe
中的自动缩放可能会因为所有z坐标相等而混淆.
How do I get it to plot the given coordinates? I would assume it has something to do with having to scale/adjust the z-axis as the automatic scaling within wireframe
is probably confused by all z-coordinates being equal.
推荐答案
只需添加一个zlim
参数.
wireframe(z~x*y,df,colorkey=TRUE,drape=TRUE, zlim=c(0,20))
这篇关于用grid :: wireframe()绘制直表面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!