gganimate

Issue with gganimate and (sometimes) empty facets

怎甘沉沦 提交于 2021-01-24 11:05:30
问题 I'm observing some behavior in gganimate that I cannot explain, and I would like to understand what I am doing wrong (or whether it is a bug). For example, here is a very simple dataset and a plot of it: library(dplyr) # dplyr_0.7.8 library(tidyr) # tidyr_0.8.2 crossing(p = 1:2, t = seq(0, 1, len = 30), s = c(0, .5)) %>% mutate(x = t, y = t^p) %>% filter(t > s) -> Z library(ggplot2) # ggplot2_3.1.0 Z %>% ggplot(aes(x,y)) + facet_wrap(~s) + geom_point() As expected the second facet (s=0.5)

gganimate plot not showing and saving bunch of .png's

白昼怎懂夜的黑 提交于 2020-12-09 18:33:21
问题 I am trying to replicate a simple example about gganimate from here. The problem is simple ggplot part works fine but when I add transition_states rstudio starts rendering and then saves bunch of gganim_plotXXXX.png files and doesn't show the expected animation. First question is obviously: Am I doing something wrong so that animation doesn't work? Second question is: Is saving bunch of .png files standard for gganimate ? Thanks in advance library(gganimate) p <- ggplot(iris, aes(x = Petal

gganimate plot where points stay and line fades

戏子无情 提交于 2020-12-04 19:57:10
问题 Here is a reproducible example of a static plot, which I want to animate (I want to show how a MCMC sampler behaves). library(tidyverse) library(gganimate) set.seed(1234) plot_data <- tibble(x=cumsum(rnorm(100)), y=cumsum(rnorm(100)), time=1:length(x)) ggplot(data=plot_data, aes(x=y, y=x)) + geom_point() + geom_line() What I'd like to see is the points being visible when they are drawn and a bit faded (i.e. alpha goes from e.g. 1 to 0.3) afterwards, while there would be a line that only shows

gganimate plot where points stay and line fades

一笑奈何 提交于 2020-12-04 19:56:26
问题 Here is a reproducible example of a static plot, which I want to animate (I want to show how a MCMC sampler behaves). library(tidyverse) library(gganimate) set.seed(1234) plot_data <- tibble(x=cumsum(rnorm(100)), y=cumsum(rnorm(100)), time=1:length(x)) ggplot(data=plot_data, aes(x=y, y=x)) + geom_point() + geom_line() What I'd like to see is the points being visible when they are drawn and a bit faded (i.e. alpha goes from e.g. 1 to 0.3) afterwards, while there would be a line that only shows

How to get rid of axis flickering caused by coord_flip when using gganimate and view_follow and geom_tile?

我与影子孤独终老i 提交于 2020-08-27 08:19:53
问题 Let's say we have this bar chart race with a scaling x-axis . Taking the code exactly from this answer by @Jon Spring and adding the very final line (before the animate line): library(tidyverse) library(gganimate) library(gapminder) theme_set(theme_classic()) gap <- gapminder %>% filter(continent == "Asia") %>% group_by(year) %>% # The * 1 makes it possible to have non-integer ranks while sliding mutate(rank = min_rank(-gdpPercap) * 1) %>% ungroup() p <- ggplot(gap, aes(rank, group = country,