gpt4 book ai didi

图中数据点的 R 箭头标记

转载 作者:行者123 更新时间:2023-12-04 09:37:10 25 4
gpt4 key购买 nike

我希望用索引标记数据点 - 通过目视检查轻松识别索引号。

所以例如,

x<-ts.plot(rnorm(10,0,1)) # would like to visually identify the data point indices easily through arrow labelling

当然,如果有更好的方法来实现这一点,请提出建议

最佳答案

您可以使用 arrows功能:

set.seed(1); ts.plot(x <-rnorm(10,0,1), ylim=c(-1.6,1.6))  # some random data
arrows(x0=1:length(x), y0=0, y1=x, code=2, col=2, length=.1) # adding arrows
text(x=1:10, y=x+.1, 0, labels=round(x,2), cex=0.65) # adding text
abline(h=0) # adding a horizontal line at y=0

enter image description here

关于图中数据点的 R 箭头标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14893602/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com