-1
x1 = df.groupby(['RIAGENDRx', 'agegrp'])['DMDMARTLx'].value_counts()
x1 = x1/sum(x1)

https://i.stack.imgur.com/gBSIh.png i have this groupyby object and i want to plot countplot using seaborn any one can help?. i tried this

sns.barplot(x= x.index, y=x.values)

but that is very diffcult to read. here is output. output of seaborn barplot

Dilshad
  • 73
  • 2
  • 9
  • 1
    Please provide your data in a copyable format and not as a picture. See [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) – Diziet Asahi Oct 06 '19 at 12:15

1 Answers1

0

You can try rotate label text:

g = sns.barplot(x= x.index, y=x.values)
g.set_xticklabels(g.get_xticklabels(), rotation=30)
Manualmsdos
  • 1,505
  • 3
  • 11
  • 22
  • thanks for feedback but its very difficult to understand graph as there any way to use gender as hue. – Dilshad Oct 06 '19 at 11:14