Comparing Distributions with Multiple Histograms

Returning to the mammalian total sleep time data set, we will consider how to depict multiple distributions with histograms and density plots. Figure @ref(fig:ggplot2-density-examples) displays four sub-categories of mammals according to their eating behaviour. Their distributions are presented using four varieties of multiple histograms and two varieties of density plots:

Stacked histograms where each bin is vertically stacked (Figure @ref(fig:ggplot2-density-examples), top-left).

Proportional stacked histograms where the height of each bin is 1 (Figure @ref(fig:ggplot2-density-examples), top-middle).

Dodged histograms where all histograms are interleaved (Figure @ref(fig:ggplot2-density-examples), top-right).

Frequency polygon where each histogram is presented as an outline instead of bars (Figure @ref(fig:ggplot2-density-examples), bottom-left).

Overlapping density plot where overlapping lines depict the density estimation (Figure @ref(fig:ggplot2-density-examples), bottom-middle).

Overlapping density area plot where overlapping transparent areas depict the density estimation (Figure @ref(fig:ggplot2-density-examples), bottom-right).

None of the histogram varieties allow the reader to see the underlying distribution of each group plotted. This is in contrast to overlapping density plots, which allow easy decoding of the underlying distributions. In particular the area-shaded density plot does an effective job of allowing the reader to distinguish between the four groups.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.

Plotting the distribution of four sub-groups using four varieties of histograms and two varieties of density plots. Top: stacked, proportional and dodged histograms. Bottom: Frequency polygon, density outline and density area plots.