【发布时间】:2019-04-05 03:25:09
【问题描述】:
利用 Github 上软件包 wiki 中的 this 示例:
airq <- airquality
airq$Month <- format(ISOdate(2004,1:12,1),"%B")[airq$Month]
ggplot(airq, aes(Day, Temp, group = Month)) +
geom_line() +
geom_segment(aes(xend = 31, yend = Temp), linetype = 2, colour = 'grey') +
geom_point(size = 2) +
geom_text(aes(x = 31.1, label = Month), hjust = 0) +
transition_reveal(Month, Day) +
coord_cartesian(clip = 'off') +
labs(title = 'Temperature in New York', y = 'Temperature (°F)') +
theme_minimal() +
theme(plot.margin = margin(5.5, 40, 5.5, 5.5))
产生类似的东西:
我想知道是否有任何方法可以在动画的特定点定义暂停。例如在第 10 天,然后是 20 天,然后当动画完成时,再次循环之前。 geom_reveal 没有可用的 state_length 或 transition_length 参数,所以我不确定这是否可行。
编辑:包作者在twitter 上提到它是可能的,但我不知道他指的是什么“揭示时间”论点。
【问题讨论】: