I'm trying to get the very long x axis label to multiple line as show in the encircled right image:
The code which I'm using currently:
ax = cluster3.plot(x='Neighborhood',y=['Population'],kind='bar',alpha=0.75,title='Population of Each Neighborhood',figsize=(15, 10))
ax.set_ylabel('Population')
cluster3 is the dataframe which has the Neighborhood column
Check this image:
Or
df['cluster3'] = ['\n'.join(wrap(x, 12)) for x in df['cluster3'])
apply this to your labels column to wrap the labels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With