-1

Is there a way to autofit x labels on a chart so they are viewable by the users? Either rotate the labels down 90 degrees or make the chart wider? My Sales departments have at least 15 characters in their name. Image attached.

sns.countplot(x='sales_dept', data=df)

Sample chart

Peter

Pete Lucas
  • 37
  • 1
  • 7

1 Answers1

0

You can use this below to rotate the labels

ax = sns.countplot(x='sales_dept', data=df)

for label in ax.xaxis.get_ticklabels():
        label.set_rotation(90)
doughboy
  • 61
  • 7