Alternative names: *Kernel density plot*, *Density trace graph*

A density plot visually resembles an area chart, but its function is quite different. Density plots are used to visualize the distribution of numerical variables over a period of time. Density plots somewhat resemble smooth peaks and valleys plotted between two axes. Every peak represents an accumulated value for the given band. Varying the bandwidth and the degree of smoothing a density plot can look significantly different.

Very often, a density plot can be used as an alternative to a histogram. However, because of its smoothness, it’s easier to capture the distribution form of the given data, while in the histogram it is harder to achieve because of the sharpness of bar bins and more issues with bin range choice. Losing the sharp edges in a density plot makes it also visually more appealing.

A ridgeline plot (also known as a joy plot) shows the distribution of a numeric value for several groups of a category. It is done by illustrating partially overlapping line charts or area charts. This way, the chart resembles a mountain range. The alternative name for a ridgeline plot is a joy plot because this very example above appeared on the first album cover of the British band Joy Division (‘Unknown Pleasures’ from 1979).

This is essentially a chopped-up ridgeline plot. If overlappings used in a ridgeline are either confusing or take too much space, every chart is sliced into bands of the same height. Then they are colored: the higher the band value the stronger color's intensity. Then they are placed on top of each other – low-value bands – underneath, high-value – above. If placed this way, all the values are visible and take significantly less space.

While the density plot is placed strictly above the X-axis line, the streamgraph expands symmetrically on both sides of the axis. While it might require a different way of reading, excluding the possibility to see every value precisely, it also allows us to see the form of distribution. Usually, a streamgraph contains several series/categories, but a single-category streamgraph could also effectively be used instead of a density plot.

A violin plot can be perceived as a combination of a density plot (or streamgraph) and a box-plot, showing not only the form of distribution but also the key points of the data: the interquartile range and the median.

The size of the band works basically the same as bins for histograms: depending on the size of the band the form of the density plot can be changed significantly, so It’s better to follow your data’s logic.

For bins, there’s also a popular way of choosing their size called Sturge’s rule. It can be also used for density plots. The formula is the following:**K**=1+3.322 log(**n**),

where:**K** is the number of bands **n** is the number of observations in a dataset.

For multiple distributions stacking is not a good solution considering that the form of the 2nd and subsequent distributions can’t be determined. In case of numerous distributions, the best option is to use overlapping areas with reduced opacity. In this case, multiple distributions can be seen at the same time.

While using overlapping areas for visualizing multiple distributions can be a good solution it’s better not to exceed the number of shown distributions above three as it can introduce visual clutter.

As an alternative to overlapping areas for two distributions a mirroring over the X-axis can be a solution. While it can lack a relative comparison of distributions this view is definitely visually cleaner.