Skip to content

Instantly share code, notes, and snippets.

@djnavarro
Created April 17, 2019 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djnavarro/12a91f50943aaeb953a1ca1b21102c30 to your computer and use it in GitHub Desktop.
Save djnavarro/12a91f50943aaeb953a1ca1b21102c30 to your computer and use it in GitHub Desktop.
gganimated version of ASCII Bayes
library(tidyverse)
library(asciify)
library(gganimate)
p <- ascii_data("bayes.png") %>%
ascii_map(
alphabet = as.character(0:9),
rescale = .15) %>%
ascii_plot(charsize = 4)
a <- p + transition_filter(
f0 = label == "0",
f1 = label == "1",
f2 = label == "2",
f3 = label == "3",
f4 = label == "4",
f5 = label == "5",
f6 = label == "6",
f7 = label == "7",
f8 = label == "8",
f9 = label == "9",
keep = TRUE
) +
exit_recolour(colour = "grey60")
animate(a, type = "cairo", width = 800, height = 480)
anim_save("~/../Desktop/bayesian_filtering.gif")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment