You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for a wonderful package! I think I found a bug, but, of course, it could also just be me doing something wrong.
Description of the issue: When adding animations to a plot where the fonts have been changed from the default, gganimate seems to ignore face = "italic" in the call to theme().
Minimal reproducible example: Below is a code snippet with a base plot where x and y labels are correctly italicised, but adding an animation changes the label font face to normal.
library(ggplot2)
library(gganimate)
base_plot <- ggplot(
data.frame(x = c(1, 4), y = c(4, 1)),
aes(x = x, y = y)
) +
geom_point() +
expand_limits(x = c(0, 5), y = c(0, 5)) +
coord_fixed(ratio = 1) +
theme_classic() +
theme(
axis.text = element_text(size = 12, family = "Helvetica", face = "plain"),
axis.title.x = element_text(size = 16, family = "Times", face = "italic", hjust = 1),
axis.title.y = element_text(size = 16, family = "Times", face = "italic", angle = 0)
)
plot(base_plot)
ggsave("base_plot.png")
base_plot +
transition_reveal(x)
anim_save("animation_plot.gif")
Output: The two plots are shown below.
The text was updated successfully, but these errors were encountered:
Thanks for a wonderful package! I think I found a bug, but, of course, it could also just be me doing something wrong.
Description of the issue: When adding animations to a plot where the fonts have been changed from the default, gganimate seems to ignore
face = "italic"
in the call totheme()
.Minimal reproducible example: Below is a code snippet with a base plot where x and y labels are correctly italicised, but adding an animation changes the label font face to normal.
Output: The two plots are shown below.
The text was updated successfully, but these errors were encountered: