Hi Community
I want make a plot animate. I need that the points appear and desappear, but only make that the movements of points.
set.seed(1)
library(tidyverse)
library(gganimate)
df <- tibble(
x = rnorm(100)
, y = rnorm(100)
, size = rep(c(2, 3, 4, 5), 25)
, cl = sample(c("a", "b"), 100, T)
, time = rep(1:10, 10) #|> lubridate::year()
)
p2 <-
df |>
ggplot() +
aes(x, y, size = size, color = cl) +
geom_point() +
scale_size(range = c(5, 12)) +
transition_reveal(time) +
#enter_fade()
#transition_manual(time) +
shadow_mark(past = F, future = T)
animate(p2, renderer = gifski_renderer("sa.gif"))
Thanks