What is each type of plot used for?

Question

In the context of this lesson, what is each type of plot in Seaborn used for?

Answer

KDE Plot
KDE plots are used to get the probability density of a random variable. Like histograms, they are used to show us the distribution of a dataset. However, they provide a smoother visualization than histograms. The area under any two points in a KDE plot is the probability that a value falls between those two points.

Box Plot
Box plots tell us how a dataset is distributed. They show us the range of all the values in the dataset, and provide us a clear visualization of the five number summary, by including the first quartile, median, third quartile, outliers and the minimum and maximum, which may or may not be outliers.

Violin Plot
These are similar to box plots, but also show the KDE of the dataset on the plots, in addition to the interquartile range and median, within a 95% confidence interval. Because these show a lot of information, violin plots are used quite often.

3 Likes

What’s the difference between probability density and distribution? Aren’t KDE plots and Box plots the same thing, with KDE plots looking slightly nicer?

1 Like

Probability density is the other face of distribution. Distribution looks at how your drawn sample is actually distributed, on the other hand probability density takes an expected distribution and tells you how likely it is that a sample mean, or a single occurrence, would come from that distribution.

KDE plots don’t tell you where the median, IQR and confidence interval are, but yeah they make up a part of violin plots, or its distribution curve plotted symmetrically on top of other information.