Published in Data & Molecule Bits
Author Giorgio Luciano
library(viridis) # Import the viridis color palette library library(ggplot2) set.seed(123) # Set a seed for reproducibility num_flips <- 50000 flips <- sample(c("Heads", "Tails"), num_flips, replace = TRUE) # Image aspect ratio aspect_ratio <- 1 # You can customize the aspect ratio here n_col <- round(sqrt(num_flips) * aspect_ratio) n_row <- ceiling(num_flips / n_col) # Create a color matrix to represent coin flips colors <-