I am working on a waffle chart and there's one aesthetic that I am having trouble with. Currently I have my waffle chart filled row-wise, but it's starting at the bottom (with category A) and filling in left to right from the bottom up. I would like to have it fill from the top (starting with category C) left to right. For example, with this implementation, at y = 0.5, the three blue squares that are on the right would instead be on the left. I haven't been able to find any arguments that address this issue.
library(waffle)
library(tidyverse)
my_data <- data.frame(category = c('A', 'B', 'C'),
count = c(20, 15, 40),
stringsAsFactors=TRUE)
my_data %>%
ggplot(aes(fill = category, values = count)) +
geom_waffle(
n_rows = 10,
size = 0.33,
colour = "white",
flip = TRUE,
make_proportional = TRUE,
na.rm = T
)
I've looked through the documentation for geom_waffle, and multiple existing stackoverflow threads about geom_waffle, but I haven't found any answers from these sources.