[英]How can remove the gaps between bars?
The code underneath works but my problem is that it prints spaces in between the bars in the histogram and I want zero space in between each bin.下面的代码有效,但我的问题是它在直方图中的条之间打印空格,我希望每个 bin 之间的空格为零。 Any suggestion is appreciated - appreciation!任何建议表示赞赏 - 赞赏!
sns.histplot(stat='frequency',data=df, x="Water",color = "red", bins=10,
alpha = 0.3, kde = True, line_kws = {'color':'red','linestyle': 'dashed'})
I want something like the below plot.我想要类似下面的 plot。
Using edgecolor
, which is passed through to Axes.bar
.使用edgecolor
,它被传递给Axes.bar
。 As an example:举个例子:
import seaborn as sns
tips = sns.load_dataset('tips')
sns.histplot(stat='frequency', data=tips, x='total_bill', color='red',
kde=True, alpha=0.3, edgecolor=None,
line_kws = {'color':'red','linestyle': 'dashed'})
Or if you want an edge, then:或者如果你想要一个优势,那么:
edgecolor='red'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.