R语言绘制平滑的热力图

# library
library(latticeExtra) 

# create data
set.seed(1) 
data <- data.frame(x = rnorm(100), y = rnorm(100)) 
data$z <- with(data, x * y + rnorm(100, sd = 1)) 

# showing data points on the same color scale 
levelplot(z ~ x * y, data, 
          panel = panel.levelplot.points, cex = 1.2
) + 
  layer_(panel.2dsmoother(..., n = 200))

在这里插入图片描述
参考文献:https://blog.csdn.net/weixin_46587777/article/details/124973766
开发工具:RStudio 2023.06.1 Build 524
微信Alt+A截屏工具

猜你喜欢

转载自blog.csdn.net/m0_38127487/article/details/131818592