r - 向条形图添加箭头时遇到问题
问题描述
我正在尝试将箭头(误差线)添加到简单的条形图中。第一个有效,最后两个只是带来大量错误消息,即使它们的格式完全相同!
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(return(expr)、name、parentenv、handler)中:零-长度箭头的角度不确定,因此被跳过 2:在 doTryCatch(return(expr), name, parentenv, handler) 中:零长度箭头的角度不确定,因此被跳过 3:在 doTryCatch(return(expr), name, parentenv , handler) :零长度箭头的角度不确定,因此被跳过 4:在 doTryCatch(return(expr), name, parentenv, handler) 中:零长度箭头的角度不确定,因此被跳过
解决方案
解决它...
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)
推荐阅读
- python - 无法从驼峰包python导入pascalize,depascalize
- reactjs - 如何在reactjs中为自动完成组件设置多值
- python - 从字典列表中查找字典键的频率
- python - 请解释一下 --> sal_range=new[0].str.split('-',n=1,expand=True) 用法?
- macos - 如何在 MacOS 上使用 IMPDP Oracle 数据库
- python - 难倒简单的 numpy 问题 - 将 2D 数组附加到 3D 数组
- c# - 是否可以覆盖特定列的 CsvHelper 的默认映射,如果它下面的字段是空字符串 - 写别的东西?
- android - 获取实例导致的 kotlin.UninitializedPropertyAccessException
- python - 如何对匿名数据集进行特征工程?
- python - 数据框列不会在python中转换为浮点数据类型