1import numpy as np
2import matplotlib.pyplot as plt
3
4# Fixing random state for reproducibility
5np.random.seed(19680801)
6
7# fake up some data
8spread = np.random.rand(50) * 100
9center = np.ones(25) * 50
10flier_high = np.random.rand(10) * 100 + 100
11flier_low = np.random.rand(10) * -100
12data = np.concatenate((spread, center, flier_high, flier_low))
13
14fig1, ax1 = plt.subplots()
15ax1.set_title('Basic Plot')
16ax1.boxplot(data)
1>>> data = np.random.randn(25, 4)
2>>> df = pd.DataFrame(data, columns=list('ABCD'))
3>>> ax = df.plot.box()
4