我想知道是否有人有问题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)
Run Code Online (Sandbox Code Playgroud)
我也尝试添加showfliers=True到该脚本的最后一行,但它仍然无法正常工作.
这是我得到的输出:
