3

I created a Seaborn barplot using the below code:

import seaborn as sns
barplot = sns.barplot(x='abc'
                      ,y='def'
                      ,data=df
                      ,ci=None
                      )
barplot.set_xticklabels(barplot.get_xticklabels(), rotation=45)    
barplot.figure

This code produced a barplot that looks like this: enter image description here

Is there a way to rotate and align the x axis labels so the barplot looks something like this? So the end of the x axis labels are aligned to the x axis?

enter image description here

I am using Python 3.6 and seaborn 0.7.1

BeeGee
  • 815
  • 2
  • 17
  • 33
  • 1
    "The labels on the x axis lose their alignment with the x axis when the labels are long." That's not accurate. They're all aligned, they are just center-aligned and not right-aligned as in the second plot. – mwaskom Jun 13 '17 at 22:43
  • good point mwaskom. I just made an edit. – BeeGee Jun 13 '17 at 22:46

0 Answers0