错误条不会在R中的y轴上绘制

错误条不会在R中的y轴上绘制,r,plot,errorbar,R,Plot,Errorbar,我的y轴上有一个对数刻度,数值为负数。我正在使用“分段”功能绘制错误条。误差条出现在我的x轴上,但不是y轴 这是我的剧本: massaxis<-read.table("mass_axis.dat", header=TRUE) x<-log((massaxis$mass)) y<-log((massaxis$semimajoraxis)) plot(x, y, type="p", main="Log(semi-major axis) vs Log(mass) for

我的y轴上有一个对数刻度,数值为负数。我正在使用“分段”功能绘制错误条。误差条出现在我的x轴上,但不是y轴

这是我的剧本:

massaxis<-read.table("mass_axis.dat", header=TRUE)

x<-log((massaxis$mass))
y<-log((massaxis$semimajoraxis))
plot(x, y, type="p",
     main="Log(semi-major axis) vs Log(mass) for all known exoplanets",
     ylab="log(Semi Major Axis) (AU)",
     xlab="log(mass) (mass in jupiter mass (Mj))")

fit<-lsfit(x, y, intercept=TRUE)
print(summary(fit))

a<-log(0.431)
b<-log(0.0556)
sigma<-0.095
delta<-0.0126
alo<-a-sigma
ahi<-a+sigma
blo<-b-delta
bhi<-b+delta

segments(alo, b, ahi, b, col="red")
segments(bhi, a, blo, a, col="red")
points(a, b, col="red")

我们无法访问您的数据集(或只是子集)。您可以使用dput()并将其包含在帖子中。只需在R中运行dput(数据集)。您真的想要
段(alo,b,ahi,b,col=“red”)
还是应该是
段(alo,a,ahi,a,col=“red”)
(以及相应的其他
段()
语句?)