简体   繁体   中英

simple R 3d interpolation / surface plot using pycnophylactic interpolation

I would like to create a 3d surface from a set of points (x,y,z) like this scenario simple R 3d interpolation/surface plot but using a specific interpolation method called pycnophylactic. There's a package called pycno with this method but I'm new in R and can't understand well how can I do it. Can anyone help me, provide a sample? My data is something like this:

x <- c(-19.915909,-19.918794,-19.914678,-1.991492,-19.916232)
y <- c(-43.942983,-43.943198,-43.940344,-43.942168,-43.939507)
z <- c(7.910,5.693,6.958,7.116,790.843)

Thanks in advance!

I used the "akima" package to interpolate the z variable. Here's how the 3D plot would look for your x, y and z.

dens <- akima::interp(x,y,z, duplicate = "mean")
plot_ly(x=dens$x,y=dens$y,z=dens$z) %>% add_surface()

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM