Note
Go to the endto download the full example code.
boxplot(X)#
Draw a box and whisker plot.
Seeboxplot.

importmatplotlib.pyplotaspltimportnumpyasnpplt.style.use('_mpl-gallery')# make data:np.random.seed(10)D=np.random.normal((3,5,4),(1.25,1.00,1.25),(100,3))# plotfig,ax=plt.subplots()VP=ax.boxplot(D,positions=[2,4,6],widths=1.5,patch_artist=True,showmeans=False,showfliers=False,medianprops={"color":"white","linewidth":0.5},boxprops={"facecolor":"C0","edgecolor":"white","linewidth":0.5},whiskerprops={"color":"C0","linewidth":1.5},capprops={"color":"C0","linewidth":1.5})ax.set(xlim=(0,8),xticks=np.arange(1,8),ylim=(0,8),yticks=np.arange(1,8))plt.show()