Let’s say that instead of categories, we wanted to look at the distribution of a set of numerical values. We’ve already explored these using histograms, and we can access histograms by using the geom_histogram function:

`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

You may have noted that we dropped the mapping= here. As long as you’re using aes, it’s not needed. You may have also noted there’s an error we get from running this command that relates to bin size. We can handle this with another argument, but for now don’t worry about it.

The boxplot

Oftentimes, we may be interested in showing distributions across multiple categories. We can view multiple distributions using a box plot:

The box plot (or box-and-whisker plot) shows the distribution of values in terms of the interquartile range, where the box represents the space between the 25% and 75% and the whiskers represent the rest. These are useful when you want to compare across multiple categories. For example: