Could not get Boxplot x-axis titles to rotate 90 degrees

Screen Link:

My Code:
cols = [‘Major_category’, ‘Median’]
category_compare = recent_grads_original[cols]

data = category_compare[‘Median’]
category = category_compare[‘Major_category’]
category_compare.boxplot(column=‘Median’, by=‘Major_category’)
plt.set_xticklabels(category, rotation=90)

Replace this line with your code

What I expected to happen:
I expected my x-axis title to be rotated 90 degrees.

What actually happened:
They were not.

Replace this line with the output/error
There was no error statement!
[Major Category Boxplot|471x500](upload://qmiTJGfgGgLs9jkEyYb8DhBYzaZ.jpeg) ![Major Category|599x453](upload://5odDcdCChlm6XV5iQEts2DnI4PH.jpeg) ```

<!--Enter other details below: -->

Hi Bruce,

To rotate the x-tick labels, you need this code, instead of those 2 lines:


Also, for limiting the y-axis, you need this code:


Thank you Elena!

1 Like