[英]Why can't I produce the min and max value of the CI in ggplot?
I want to draw a ggplot with geom_errorbar, normally min and max value of the CI is produced automatically, but I can't get it.我想用 geom_errorbar 绘制一个 ggplot,通常 CI 的最小值和最大值是自动生成的,但我无法得到它。 See the the codes below and expected part of the graph which is showed in the red circle.
请参阅下面的代码和红色圆圈中显示的图表的预期部分。
df14<-data.frame(size=c(1750,2000,2500,3000,1750,2000,2500,3000),
ratio=c(1.41,1.35,1.29,1.48,2.03,2.12,2.31,1.96),
IQ =c( "M","M","M","M","F",
"F","F","F"))
ggplot(df14, aes(x= size, y=ratio, colour=IQ)) +
geom_errorbar(aes(ymin=ratio-0.05, ymax=ratio+0.05), colour="black", width=.1) +
geom_line( ) +
geom_point( )
Just leave the width out - or try it with a larger width.只需保留宽度 - 或尝试使用更大的宽度。 Or do you mean something else, when you say how can I make the errobar smaller ?
或者你的意思是别的什么,当你说我怎样才能让 errobar 变小?
library(ggplot2)
ggplot(df14, aes(x= size, y=ratio, colour=as.factor(IQ))) +
geom_errorbar(aes(ymin=ratio-0.05, ymax=ratio+0.05),
width = 50, colour="black") +
geom_line( ) +
geom_point( )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.