Bar plot

To draw a bar plot, we use the following barplot method:

sns.barplot(x="season", y="us_viewers_in_millions", data=df);

The output is as follows:

Note that there is another version of bar plots available, and these are drawn using the countplot method, as follows:

sns.countplot(x="season", data=df);

The output of the preceding code is as follows:

This style of plot can be used when you want to show the number of observations in each category, rather than compute a status for the second variable.

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.