PosixCt 的默认轴格式
有没有办法可以更改 POSIXct 标签在使用 plot
时以及它们是数据帧的一部分时的显示方式的默认格式(Date HH:MM
而不仅仅是 HH:MM
)?
如果我可以做到这一点而不必每次都发出 axis 命令或将数据帧转换为 xts 对象,那就太好了。
Is there a way I can change the default format for how POSIXct labels appear when using plot
and when they are part of a dataframe (Date HH:MM
instead of just HH:MM
)?
I would be nice if I could do this without having to issue an axis
command each time or converting the dataframe to an xts
object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是文森特·佐尼肯德 (Vincent Zoonekynd)。
您可以在
plot
函数中使用format
参数以“%Y-%m-%d %H:%M”格式输出数据。请看下面的代码:
输出:

Answer goes to Vincent Zoonekynd.
You can use
format
argument inplot
function to output the data in "%Y-%m-%d %H:%M" format.Please see the code below:
Output:
