gganimate
gganimate copied to clipboard
geom_text in animation producing very bad font quality
When using geom_text to put labels on an animation, the labels are rendered in very bad quality.
Is there a way to circumvent this problem?
The following piece of code and the attached gif file demonstrate the problem
suppressPackageStartupMessages({
library(tidyverse)
library(gganimate)
})
iris <- as_tibble(iris)
p <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) +
geom_point() +
geom_text(x=1.25,y=1.5,label="Species")
plot(p)
anim <- p +
transition_states(Species,
transition_length = 2,
state_length = 1)
anim_save("geom_text_problem.gif")

Using annotate instead of geom_text solves the problem.