stackedbar() — Stacked bar chart

Bars split into parts that stack to a total.

barplot(rbind(a, b))

Key idea

In plain words

Each bar is a stack of coloured blocks — the taller the stack, the bigger the total, and each block is one part of it.

Where you'd use it

Frequently asked questions

Why are stacked bars hard to read?
Only the bottom segment shares a baseline, so upper segments are hard to compare across bars.