无法添加箭头柱状图

问题描述 投票:0回答:1

我想箭头(误差条)添加到一个简单的柱状图。第一个作品,最后两个只是弹出错误信息的负荷,即使他们在完全相同的方式被格式化!

secondtimes<-c(568.4667,604.2,585.8)
xabels<-c("1","2","3")
secondplot<-barplot(secondtimes,xlab = "Treatment",ylab = "Time taken / secs",ylim = c(0,800))
axis(1,at=secondplot,labels=xabels)  
arrows(0.7, 522.3074, 0.7, 614.6259, length=0.05, angle=90, code=3)
arrows(1.9, 496.4951, 1.9, 496.4951, length=0.05, angle=90, code=3)
arrows(3.1, 482,3277,3.1, 689.2723, length=0.05, angle=90, code=3)

误差在箭头(1.9,496.4951,1.9,496.4951,长度= 0.5,角= 90,:无效箭头规范此外:警告信息:1:在doTryCatch(返程(表达式),名称,parentenv,处理程序):零长度箭头是不确定的角的和,从而跳过2:在doTryCatch(返程(表达式),名称,parentenv,处理程序):长度为零的箭头是不确定的角的和,从而跳过3:在doTryCatch(返程(表达式),姓名,parentenv ,处理程序):长度为零的箭头是不确定的角度的,因此跳过4:在doTryCatch(返程(表达式),名称,parentenv,处理程序):长度为零的箭头是不确定的角度,因此跳过的

This is how the plot turns out

r
1个回答
1
投票

修复...

secondtimes<-c(568.4667,604.2,585.8)
xabels<-c("1","2","3")
secondplot<-barplot(secondtimes,xlab = "Treatment",ylab = "Time taken / secs",ylim = c(0,800))
axis(1,at=secondplot,labels=xabels)  
arrows(0.7, 522.3074, 0.7, 614.6259, length=0.05, angle=90, code=3)
arrows(1.9, 496.4951, 1.9, 711.9049, length=0.05, angle=90, code=3)
arrows(3.1, 482.3277,3.1, 689.2723, length=0.05, angle=90, code=3)
© www.soinside.com 2019 - 2024. All rights reserved.