0% appearing in the bottom of graph saeborn.catplot

23 views Asked by At

i am facing a problem using below code: link of dataset (df): https://archive.ics.uci.edu/dataset/468/online+shoppers+purchasing+intention+dataset

x,y = 'VisitorType', 'Weekend'
df1 = df.groupby(x)[y].value_counts(normalize=True)
df1 = df1.mul(100)
df1 = df1.rename('percent').reset_index()
g = sns.catplot(x=x,y='percent',hue=y,kind='bar',data=df1, palette=sns.color_palette(['#B8860B', '#556B2F']))
g.ax.set_ylim(0,100)
for p in g.ax.patches:
    txt = str(round(p.get_height(), 2)) + '%'
    txt_x = p.get_x()
    txt_y = p.get_height()
    g.ax.text(txt_x,txt_y,txt)

0% is appearing, see red circle

please help me to resolve the issue

0

There are 0 answers