[英]plotting POSIXct values in R
Im trying to plot datetimes of customer visits using a histogram but for some reason my plots are producing scientific notation for the y axis.我正在尝试使用直方图 plot 客户访问的日期时间,但由于某种原因,我的绘图正在为 y 轴生成科学记数法。 My code is as follows:
我的代码如下:
hist(tsData, breaks = "months", plot = TRUE, freq = FALSE,
start.on.monday = TRUE, format)
hist(tsData, breaks = "hours", plot = TRUE, freq = FALSE,
start.on.monday = TRUE, format)
Which produce the following plots respectively,分别产生以下图,
My POSIXct values are in the format: "2018-03-13 10:18:14" for every visit.我的 POSIXct 值的格式为:每次访问的“2018-03-13 10:18:14”。 Am I plotting these date times incorrectly?
我是否错误地绘制了这些日期时间?
Without seeing your data, I cannot tell for certain, but your horizontal axes seem to suggest you are plotting the date-times correctly.如果没有看到您的数据,我无法确定,但您的水平轴似乎表明您正在正确绘制日期时间。
As for your vertical axis, it is showing scientific notation because the density values are very small.至于你的垂直轴,它显示科学计数法,因为密度值非常小。 In your first plot,
1.0e-08
is the same as 0.00000001
.在您的第一个 plot 中,
1.0e-08
与0.00000001
相同。 It may be that the format
you are passing to hist
is setting the y-axis to scientific notation.您传递给
hist
的format
可能是将 y 轴设置为科学记数法。 Regardless, neither 1.0e-08
nor 0.00000001
are very readable.无论如何,
1.0e-08
和0.00000001
都不是非常可读的。 Since the probability densities are so small, your histograms may be more intelligible if you set freq = TRUE
to show the counts.由于概率密度非常小,如果您设置
freq = TRUE
来显示计数,您的直方图可能更容易理解。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.