If one uses hue
in seaborn's barplot and one of the categories is missing, it leads to this strange effect of "empty columns" where seaborn plots nothing at the place where it expects the hue to be (see below at the second position, Fri; or in the second picture). How can one centre such cases so that it is at the place of the tick? In the first case, it would be in the middle of the orange bar, in the second it would remove the empty space between the blue and green and place the tick in the middle of the green bar.
Thanks.
import seaborn
tips = sns.load_dataset("tips")
tips.loc[(tips["sex"]=="Male")&(tips["day"]=="Fri"), "total_bill"]=np.nan
sns.barplot(x="day", y="total_bill", hue="sex", data=tips)
sns.barplot(x="sex", y="total_bill", hue="day", data=tips)
Side note, it is unrelated to this post.