给定以下R代码:
require(lattice)
x <- c(1:10)
y <- c(1:10)
g <- expand.grid(x = 1:10, y = 1:10, gr = 1:2)
g$z <- c(as.vector(outer(x,y,"*")), rep(50,100))
wireframe(z ~ x * y, data = g, groups = gr)结果曲面的交点是丑陋的,因为它沿着网格线。
除了增加网格的分辨率之外,有没有办法让曲面之间的交点看起来更好?也许可以通过传递一些参数或使用另一个包进行可视化?
发布于 2013-12-13 20:45:54
好吧,既然我忍不住偷懒,这里有一些可能的方法来平滑你的数据。
软件包scvm似乎有一些2D模型拟合工具。
这里推荐使用fields包:How can I smooth an array in R?
在这里查看DiceKriging包:https://stats.stackexchange.com/questions/13510/fitting-multivariate-natural-cubic-spline
https://stackoverflow.com/questions/20539099
复制相似问题