【发布时间】:2020-08-10 19:56:05
【问题描述】:
我无法确定秤上条形的位置。我理解它是一些色相量为 0,所以这会偏离条形的位置。在图像中,右上角的图显示了“劳动力”的绿色和棕色条,它们之间有一个间隙,大概是因为该颜色为 0。有没有办法将这些条放在一起,并与它们在 y- 上的对应关系一致轴?
grid = sns.catplot(x='Type', y='count',
row='Age', col='Gender',
hue='Nationality',
data=dfNorthumbria2, kind='bar', ci=None,legend=True)
grid.set(ylim=(0,5), yticks=[0,1,2,3,4,5])
grid.set(xlabel="Type of Exploitation",ylabel="Total Referrals")
for ax in grid.axes.flatten():
ax.tick_params(labelbottom=True, rotation=90)
ax.tick_params(labelleft=True)
grid.fig.tight_layout()
leg = grid._legend
leg.set_bbox_to_anchor([1.1,0.5])
【问题讨论】:
标签: python matplotlib seaborn facet-grid