Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove blank squares from waffle chart

I'm trying to make a waffle chart in R using the waffle package. I don't have an even number of entries (49) and I get blank filler squares in my otherwise perfect chart (see purple/blue squares).

Sample Chart

Here is an example of the code:

library('waffle')
basedata <- c(11,38)
names(basedata) <- c("Awsome", "Not Awsome")
waffle(basedata, rows = 2)

Any idea how to remove the blank filler squares?

like image 783
J Stewart Avatar asked Sep 17 '25 07:09

J Stewart


1 Answers

You don't need to "white out" the fillers. It's a known weird behaviour of waffle.

Just pass two colors:

waffle(basedata, rows = 2, colors = c("blue", "red"))

Awesome plot

like image 125
Roman Avatar answered Sep 19 '25 01:09

Roman