请问有人在使用Matplotlib的箱线图时发现离群值没有显示吗?我直接将这个例子复制粘贴到Python脚本中:http://blog.bharatbhole.com/creating-boxplots-with-matplotlib/,但是箱线图中的离群值并没有显示出来。有人知道为什么会出现这种情况吗?如果这个问题太幼稚了,请见谅,但我真的想不明白它为何不能正常工作。
## Create data
np.random.seed(10)
collectn_1 = np.random.normal(100, 10, 200)
collectn_2 = np.random.normal(80, 30, 200)
collectn_3 = np.random.normal(90, 20, 200)
collectn_4 = np.random.normal(70, 25, 200)
## combine these different collections into a list
data_to_plot = [collectn_1, collectn_2, collectn_3, collectn_4]
# Create a figure instance
fig = plt.figure(1, figsize=(9, 6))
# Create an axes instance
ax = fig.add_subplot(111)
# Create the boxplot
bp = ax.boxplot(data_to_plot)
我也尝试在该脚本的最后一行添加showfliers=True
,但它仍然无法工作。
这是我的输出结果: