Search code examples
rggplot2waffle-chart

Waffle package: Colors mixed up with a Zero/0 in data


An example from my data:

1 99
85 15
8 92
1 99
10 90
0 100

The problem is the last set of numbers: When there is a 0 included, waffle behaves like it's a 100. The zero seems to be ignored. Is there a way to prevent this?

Working: Green = 10, orange = 90

waffle(c(10, 90))

enter image description here

Not working: Green = 0, but its visualized as Green = 100. Every rectangle should be orange

waffle(c(0, 100))

enter image description here


Solution

  • Danke for finding this and filing the issue! Fixed in 0.6.0.9000:

    gridExtra::grid.arrange(
      waffle(c(thing1=0, thing2=100), rows=5),  
      waffle(c(thing1=25, thing2=75), rows=5)
    )
    

    enter image description here