如何在 R 中的 X 轴上绘制时间 (HH:MM:SS)
我尝试阅读stackoverflow、博客、书籍等,但无法找到有关在R中以以下格式(HH:MM:SS.000)在x轴上绘制时间以及在y轴上绘制另一个数量的答案轴。我有以下数据集:
Time EcNo
12:54:09.000 -14.47
12:54:10.000 -17.96
12:54:11.000 -15.97
12:54:12.000 -14.61
12:54:13.000 -12.68
12:54:14.000 -10.73
12:54:15.000 -10.54
12:54:16.000 -11.62
12:54:17.000 -12.49
12:54:18.000 -11.12
如何以 HH:MM:SS.000 格式在 Y 轴与时间(x 轴)上绘制 EcNo,如上所示。
老实说,我希望得到一些帮助。 非常感谢
I have tried to read through stackoverflow, blogs, books etc but have been unable to find the answer on plotting time in the x-axis in the following format(HH:MM:SS.000) in R and another quantity on the y-axis. I have the following dataset:
Time EcNo
12:54:09.000 -14.47
12:54:10.000 -17.96
12:54:11.000 -15.97
12:54:12.000 -14.61
12:54:13.000 -12.68
12:54:14.000 -10.73
12:54:15.000 -10.54
12:54:16.000 -11.62
12:54:17.000 -12.49
12:54:18.000 -11.12
How would I plot EcNo on Yaxis vs Time(x axis) in the format HH:MM:SS.000 as shown above.
I honestly would appreciate some help.
many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您也可以尝试
ggplot
:scale_x_datetime
是一个ggplot
函数,但是对于很好的参数date_breaks
和date_format
你需要包scales
:You may also try
ggplot
:scale_x_datetime
is aggplot
function, but for the nice argumentsdate_breaks
, anddate_format
you need packagescales
: