1. Using Seaborn Styles
Choosing the right type of plot is only the first step in creating effective visualizations. It is also important to configure the other aspects of your visualizations such as the layouts, labels, and colors. These traits are referred to as the visualization's aesthetics. Seaborn provides many functions for configuring your plots so that they have the most impact. In this lesson, we will cover how to use Seaborn's style functions to dramatically alter the way your data is displayed.
2. Setting Styles
Seaborn has several default built in themes that are more appealing than the default matplotlib styles. In order to set a default theme, use the sns-dot-set() function. In this example, we can look at the distribution of college tuition fees in the US. The first image shows the standard pandas histogram and the second plot shows what the histogram looks like with Seaborn's style. Notice how the color palette is muted and the grid lines are displayed. This is the default Seaborn style, also called darkgrid.
3. Theme examples with sns.set_style()
Styles control multiple aspects of the final plot including the color palette and the use of grid lines or tick marks. Depending on the visualization, one style may be more beneficial than others for conveying your message. The best approach is to experiment with the styles and use the one that works best for your needs. This example shows the impact changing styles can have when plotting your data.
4. Removing axes with despine()
In general, visualizations are more impactful if the amount of excess "chart junk" is removed. A common use case is to remove the lines around the axes called spines. Seaborn's despine() function removes one or more of the spines on a chart. The default is to remove the top and right lines but more can be removed by passing arguments to the despine() function.
5. Let's practice!
Now that you have learned about some simple methods for modifying the aesthetics of your plots, let's try some examples on your own.