[英]How can I visualise time series with coordinates?
我試圖繪制這些數據。 我不確定要使用哪個包。
excel中的數據看起來像這樣
Time [4710.19 4710.21 4710.23 4710.24 4710.26 4710.28 4710.29]
X [176.5 176.5 176.5 177 179 180.5 182.5 185.5]
Y [222 227.5 237 247.5 263 278 296 314]
我想沿着時間戳獲得X和Y圖的動畫。
我嘗試使用gganimate
包可視化數據。
library(gganimate)
library(ggplot2)
Time = c(4710.19, 4710.21, 4710.23, 4710.24, 4710.26, 4710.28, 4710.29, 4710.30)
X = c(176.5, 176.5, 176.5, 177, 179, 180.5, 182.5, 185.5)
Y = c(222, 227.5, 237, 247.5, 263, 278, 296, 314)
dat = data.frame(Time, X, Y)
ggplot(dat, aes(X, Y)) +
geom_point()+
theme_minimal() +
transition_states(Time) +
ease_aes('cubic-in-out')
這對我有用。 請試試。 您需要安裝ggplot2
和gganimate
包才能生成此可視化。 我希望你覺得這有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.