我使用R中的dtwclust包来获取图片中的集群。
dtw_cluster2 = tsclust(transdatawide2, type="partitional",k=4,preproc = zscore,
distance="dtw_basic",centroid = "pam",trace=T)
plot(dtw_cluster2)

我想要更改标签x,其中数字显示为实际日期,并添加图例以了解哪个时间序列对应于什么。你知道怎么做吗?
head(transdatawide2)
2015-01-06 2015-02-03 2015-03-02 2015-03-03
A 0.00000 0.00000 0.0 0.00000
B 0.10000 0.10000 0.1 0.00000发布于 2019-01-21 23:06:39
使用labs.arg参数。您可以在此处找到更多详细信息dtwclust documentation
使用plot(dtw_cluster2) + labs(title = "New plot title", x = "New x label")
或者您也可以使用plot(dtw_cluster2) + xlab("New x label")+ ylab("New x label") + ggtitle("New plot title")
希望这能对你有所帮助
https://stackoverflow.com/questions/54291246
复制相似问题