Making box plots to show the interquartile ranges and the outliers

We will begin by importing the data. Start by generating normal Gaussian distributions with a couple of different properties, as follows:

# Generate some Normal distributions with different propertiesrands1 = np.random.normal(size=500)rands2 = np.random.normal(scale=2, size=500)rands3 = np.random.normal(loc=1, scale=0.5, size=500)gaussians = (rands1, rands2, rands3)
  1. Make some box plots out of this data. Hence, by making a box plot of Gaussians, we can comment to suppress the output. Here, we can see that we get the following plot:
# Basic Boxplotplt.boxplot(gaussians);

Following is the output of the preceding code:

This kind of box plot was invented at Bell Labs about fifty ...

Get Mastering Matplotlib 2.x now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.