【发布时间】:2020-07-30 02:23:26
【问题描述】:
我可以通过传入 hist_kws 参数来为 seaborn 直方图设置边缘颜色:
sns.distplot(ad_data["Age"], kde = False, bins = 35, hist_kws = {"ec":"black"})
但是,我无法为 seaborn 联合图中的直方图设置类似的边缘颜色。它不接受 hist_kws 参数或任何其他类似的参数来设置边缘颜色。我在文档中找不到任何解决此问题的内容。任何帮助将不胜感激。
作为参考,我使用的是 seaborn 0.9 和 matplotlib 3.1。
【问题讨论】:
-
你可以使用
edgecolor=代替dupe中显示的color= -
@DavidG 不幸的是,它没有。 sns.jointplot("Age", "Area Income", data = ad_data, margin_kws={'edgecolor': 'green'}) 我使用上面的代码得到了一个 TypeError: distplot() got an unexpected keyword argument 'edgecolor' .但是,使用 sns.set 设置 sns 样式确实设置了 edgecolors。
标签: python-3.x matplotlib seaborn