我正在尝试使用Python的Seaborn软件包绘制多个黑白箱形图。默认情况下,这些图表使用彩色调色板。我希望将它们绘制成实心黑色轮廓。我能想出的最好办法是:
我试图使用 Python 的 Seaborn 软件包绘制多个黑白箱线图。默认情况下,这些图使用颜色调色板。我希望以纯黑色轮廓绘制它们。我所能想到的最好方法是:
# figure styles
sns.set_style('white')
sns.set_context('paper', font_scale=2)
plt.figure(figsize=(3, 5))
sns.set_style('ticks', {'axes.edgecolor': '0',
'xtick.color': '0',
'ytick.color': '0'})
ax = sns.boxplot(x="test1", y="test2", data=dataset, color='white', width=.5)
sns.despine(offset=5, trim=True)
sns.plt.show()
这将产生类似于:
我希望盒子轮廓为黑色,没有填充或颜色调色板中的任何变化。