Skip to main content

What is a stacked bar chart?

A stacked bar chart visualizes the microbial composition of samples. Each bar is one sample (or one group of samples), and each colored segment inside the bar is a microbial feature (a taxon or function), sized by how much it contributes to the profile. For example, if a species fills half of a sample’s bar, it accounts for roughly 50% of that sample’s microbial profile.

Why is it useful?

Stacked bar charts give a quick, intuitive way to compare taxonomic or functional composition across samples: whether profiles look similar, whether specific taxa dominate certain samples, and whether biological or experimental groups differ. They’re especially useful for questions like:
  • Do treated and control samples have visibly different taxonomic profiles?
  • Are specific taxa enriched in one disease group?
  • Do samples from the same body site show similar composition?
  • Are there dominant taxa that characterize a subgroup of samples?
  • Is a metadata variable associated with a visible shift in composition?
Stacked bar charts are exploratory. They reveal visual patterns and generate hypotheses, but they don’t test statistical significance on their own. Follow up a visible difference with differential abundance testing, diversity analysis, or a machine-learning model, depending on your question.