1import matplotlib.pyplot as plt
2import numpy as np
3
4data_to_plot = np.random.rand(100,5)
5
6fig = plt.figure(1, figsize=(9, 6))
7ax = fig.add_subplot(111)
8bp = ax.boxplot(data_to_plot, showmeans=True)
9
10plt.show()
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)
1import numpy as np
2import matplotlib.pyplot
3matrix=np.random.rand(10,10)
4plt.boxplot(matrix)