如何从r图形图中获取点击鼠标点的坐标

时间:2014-08-19 11:21:13

标签: r plot time-series

我在R中绘制了一幅图。如果我想在图表上点击鼠标点的坐标,我该怎么办?

我对此进行了一些搜索,并了解“识别”'功能正在用于此,但我还不太了解如何使用它。请详细解答,这是我第一次使用R

我用来绘制图表的脚本:

data <- read.csv('C:\\project\\data.csv', header=T)
plot(data$time, data$param1, ylim=c(-1,1))
points(data$time, data$param2, col='red')
points(data$time, data$param3, col='green')
points(data$time, data$param4, col='blue')

数据如下:

time,param1,param2,param3,param4
1,-0.000963631,0.00340714,8.39E-05,0.999994
2,0.0841218,0.990477,0.0119087,0.108337
3,0.077221,0.995096,0.027441,0.0553834
4,0.0669772,0.996577,0.0441491,-0.0199725
5,0.0523895,0.989463,0.0645968,-0.118515

,图表如下: enter image description here

我这样做的原因是确定此时间序列数据中的周期,并在数据文件中将它们标记为cycle1,cycle2..cyclen。

0 个答案:

没有答案