我正在尝试使用 nPlot 绘制时间序列图,并且难以以理想的方式呈现 X 轴的标签。我一直在寻找这个问题之前是否出现过并且它确实出现了但还没有解决方案(据我设法找到),我想知道是否已经有解决方案?
在这种情况下,我在 -1 和 1 之间的范围内得到 X 轴,并且图表上没有线条:
date = c("2013-07-22", "2013-07-29" ,"2013-08-05", "2013-08-12", "2013-08-19","2013-08-26", "2013-09-02" ,"2013-09-09" ,"2013-09-16")
test = as.data.frame(date)
test$V1 = c("10","11","13","12","11","10","15","12","9")
test$V2 = c("50","51","53","52","51","50","55","52","59")
test1 = melt(test,id = c("date"))
n1 = nPlot(value ~ date, group = "variable", data = test1, type="lineWithFocusChart")
如果我添加,然后再次绘制:
test1$date = as.Date(test1$date)
我得到了想要的图表,但 X 轴标签是数字形式(15900 ..)
谢谢。