我想为两个不一致的 x 值范围绘制两个 y 值。我已尝试该plot(rect())
命令未成功。
我对 x 范围和 y 值的输入分别是:
[1, 2.7] 0.05325728
(2.7, 155] 0.05179712
很感谢任何形式的帮助!
我想为两个不一致的 x 值范围绘制两个 y 值。我已尝试该plot(rect())
命令未成功。
我对 x 范围和 y 值的输入分别是:
[1, 2.7] 0.05325728
(2.7, 155] 0.05179712
很感谢任何形式的帮助!
将所有数据放入 adata.frame
中可能会有所帮助:
dat <- data.frame(x1=c(1,27),x2=c(27,155),y=c(0.05325728,0.05179712))
# x1 x2 y
#1 1 27 0.05325728
#2 27 155 0.05179712
# specify a height for the rectangles
hght <- 0.01
with(dat,plot(NA,xlim=c(min(x1),max(x2)),ylim=c(min(y),max(y)+hght),type="n"))
with(dat,rect(x1,y,x2,y+hght))