在下面的方框图中,我要删除传单的黑色边缘(粉红色圆圈)。但是,它似乎不起作用。这是我的代码:

bp = plt.boxplot(boxes)
for flier in bp['fliers']:
    flier.set(marker = 'o', color = '#e7298a', alpha = 0.5, linewidth = 0.0)


python - 删除matplotlib箱线图传单的边宽-LMLPHP

最佳答案

您在生成图时是否尝试过设置样式?

flierprops = dict(marker='o', markerfacecolor='green', markersize=12, linestyle='none')


或(未经测试)

flierprops = dict(marker='o', fillstyle='full', markeredecolor='red', markeredgewidth=0.0)


然后

boxplot(data, flierprops=flierprops)


来自以下示例:http://matplotlib.org/examples/statistics/boxplot_demo.html

关于python - 删除matplotlib箱线图传单的边宽,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32443015/

10-12 23:56