r - 隐藏在图的分箱区域后面的几何回归线
问题描述
我正在尝试在带有分箱数据的图中添加带有 geom_smooth 的回归线。该线出现但隐藏在绘图的分箱区域后面。我试图弄清楚如何让 geom_smooth 对象出现在它的前面。
Nbin <- 150
bindata <- with(DEMtestf50, condense(bin(Delta_z, find_width(Delta_z, Nbin)),bin(veg_height, find_width(veg_height, Nbin))))
smoothBinData <- smooth(peel(bindata), h=c(15, 15))
plot.new()
ggplot(data= bindata, aes(veg_height, Delta_z, fill = .count))+
geom_smooth(data= bindata, aes(veg_height, Delta_z, col="Tree height vs DEM error"), method = "lm")+
geom_tile() + ggtitle("Tree Height vs DEM Error") +
ylab("Tree Height (m)") + xlab("Delta Height (m)")
解决方案
推荐阅读
- c# - 可以在使用旧版本 c# 的项目中使用使用较新版本 c# 构建的 NuGet 包吗?
- python - 如何将每个数字除以python中每一行的总和
- python - 为什么我的简单代码即使很简单也不能运行,而不是我的
- postgresql - 在这种情况下有什么问题,因为从 postgres 函数返回自定义类型集
- reactjs - 如何从一个组件导入功能对另一个组件做出反应以呈现它?
- ios - 无法解析托管在 azure 管道中的 azure devops 上的 swift 包,SSH 指纹无法验证
- jenkins - Jenkins 无法发现 Bitbucket 存储库
- ios - 使用 VPN 从 safari 拦截 IP 地址或域名
- reactjs - 反应:消毒剂/替换用户输入(直接)
- qt - 无法将 Qt3DCore::Quick::Quick3DEntity 分配给 QQmlComponent