When to use bars

Visualization Best Practices in R

Nick Strayer

Instructor

Why not use faceting?

  • Almost impossible to compare

Visualization Best Practices in R

The stacked bar chart

  • Allow each population to share the same y-axis
  • Enables easier comparisons based on vertical position/size
who_disease %>% 
  filter(region == 'SEAR') %>% 
  ggplot(aes(x = countryCode, y = cases, fill = disease)) +
    geom_col(position = 'fill')

Visualization Best Practices in R

Caveats

  • Worse in isolation than pie or waffle charts
  • Accuracy degrades rapidly after 3 classes

Visualization Best Practices in R

Chapter recap

Proportions:

Pie charts:

Waffle charts:

Stacked bars:

Visualization Best Practices in R

Let's practice!

Visualization Best Practices in R

Preparing Video For Download...