1. Using the distribution plot
Now that you have a basic understanding of Seaborn and how it relates to matplotlib and pandas, we will spend some time looking at how to customize distribution plots in Seaborn. The basic ideas learned with this plot type can be applied to the other Seaborn plotting functions we will see in upcoming exercises.
2. Creating a histogram
The Seaborn API supports customizing the type of plot by using different arguments. In this example, we can use the same displot() function to create a standard histogram and overlay a kernel density element or KDE plot and customize the number of bins to further understand how the values are distributed. This basic approach is used by most functions in Seaborn and is a powerful tool for analyzing data quickly.
3. Alternative data distributions
As you can see, the displot() function has several options for configuration and customization. For example, setting the rug argument to True adds tickmarks for each observation. The benefit of this approach is that you can rapidly try different views and settle on the one that seems most appropriate for your analysis. Trying different combinations of the kde and rugplot can yield important insights.
4. Further plot types
There are many functions in Seaborn that build upon each other. The displot() function we have been discussing relies on using additional Seaborn functions such as the kdeplot(),rugplot() and ecdfplot(). By understanding this relationship, you can further customize Seaborn plots by passing additional arguments to the underlying functions. In this case, we are using an Estimated Cumulative Density Function to illustrate the proportion of the wine with alcohol percentages over a given amount.
5. Let's practice!
Now that you know about several Seaborn functions, let's practice some more.