在ggplot2中使用错误条定位闪避 [英] Position dodge with error bars in ggplot2

查看:165
本文介绍了在ggplot2中使用错误条定位闪避的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用ggplot来显示不同时间点的一系列置信区间。我有两组置信区间,一个参数和一个引导程序,我想用 geom_errorbar()来显示它们。我尝试过使用 position_dodge(),因此两个配置项不会直接相互覆盖,但它不起作用。

  pd<  -  position_dodge(.6)
ggplot我如何在同一时间点抖动配置项? (结果,aes(x =间隔,y =变化))+
geom_errorbar(aes(ymin = ci.par.low,ymax = ci.par.hi),position = pd,width = .1,color =
green)+
geom_errorbar(aes(ymin = ci.boot.low,ymax = ci.boot.hi),width = .1,color =blue)+
geom_abline(截距= slope.est,slope = 0,color =red)+
实验室(title = paste(Protein ID:,prot.name))
$ b $


解决方案

b

I am trying to use ggplot to show a series of confidence intervals across different time points. I have two sets of confidence intervals, one parametric and one bootstrap, and I would like to display them using geom_errorbar(). I tried using position_dodge() so the two CI won't directly overlay one another, but it is not working. How do I jitter the CI at the same time point?

pd <- position_dodge(.6)
ggplot(results, aes(x=intervals, y = change)) +
geom_errorbar(aes(ymin=ci.par.low, ymax=ci.par.hi), position = pd, width=.1, colour =
"green") + 
geom_errorbar(aes(ymin=ci.boot.low, ymax=ci.boot.hi),  width=.1, colour = "blue") +
geom_abline(intercept = slope.est, slope = 0, colour = "red") +
labs(title = paste("Protein ID:", prot.name))

解决方案

I accomplished my goal with position_jitter(), though it's clunky.

这篇关于在ggplot2中使用错误条定位闪避的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆