问题描述
我在为 geom_tile()
绘图设置动画时遇到问题,其中磁贴出现后仍然可见。
这是我使用 airquality
数据的代码。
首先是静态图。这里,x 轴是天。 y 轴是月份,温度是填充。
library(gganimate)
anim <- ggplot(airquality,aes(x = Day,y = Month,fill = Temp)) +
geom_tile()
anim
使用 transition_reveal()
不会在沿着 Day 遍历时在视觉上保留 Temp 磁贴。
anim1 <- anim + transition_reveal(Day)
anim1
我也用 transition_time()
尝试过,但没有成功。
感谢您的帮助!