【问题标题】:Getting rid of horizontal lines in error bars in plotCI消除plotCI中误差线中的水平线
【发布时间】:2014-07-10 12:23:34
【问题描述】:

我正在使用 {plotrix} 包中的 plotCI 函数。请看下图:

如您所见,误差线有两条水平线(一条顶部和一条底部)。有谁知道如何摆脱这些线条?

这是我从here借来的可重现代码:

require(plotrix)
y<-runif(10)
err<-runif(10)
plotCI(1:10,y,err,2*err,lwd=2,col="red",scol="blue", 
              main="Add colors to the points and error bars")
lines(1:10, y)

【问题讨论】:

    标签: r plot


    【解决方案1】:

    函数plotCI() 有参数sfrac= 确定这些行的长度。将此参数设置为 0 将删除行。

    plotCI(1:10,y,err,2*err,lwd=2,col="red",scol="blue", 
           main="Add colors to the points and error bars",sfrac=0)
    

    【讨论】:

    • 完美答案。非常感谢。
    猜你喜欢
    • 2020-11-05
    • 1970-01-01
    • 2013-11-09
    • 1970-01-01
    • 1970-01-01
    • 2019-10-14
    • 2015-03-06
    • 2021-03-07
    • 1970-01-01
    相关资源
    最近更新 更多