Skip to content

filmicaesthetic/TetrisChart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blocks_plot

A function to create a Tetris-themed plot using ggplot2’s geom_col.

Example of Tetris plot, showing count of video games with over 5 million sales by manufacturer

Data

Use

This plot format is very limited for practical use, and is best used to count occurrences of factors in very small datasets (<100 rows).

Clone and run blocks_plot.R and use blocks_plot() to plot data.

blocks_plot(data = NULL, count_col = NULL, bgcolor = "#ffffff", blockcolor = "#394d6e")

Arguments

  • data : The data to use for the plot
  • count_col : The name of column to plot
  • bgcolor : colour of plot background
  • blockcolor : colour of plot grid lines

Example:

blocks_plot(data = df, count_col = "col_5", bgcolor = "#000000", blockcolor = "grey")

See full example here

Issues

  • Currently has trouble outputting with ggsave

About

Function to create a Tetris-themed chart with ggplot2

Resources

Stars

Watchers

Forks

Languages