2

I'm unable to remove the label "Age" under each box plot shown below. Its autogenerated and can't get rid of it. Here is my code and output:

dataset.boxplot(column=['Age'], by=None, ax=None, fontsize=None, rot=0, 
grid=True, figsize=None, layout=None, return_type=None)
plt.suptitle('Attrition by Age')
plt.xlabel('test')
plt.title('test6')
plt.subplot(121)
plt.xlabel('test2')
plt.title('test3')
plt.ylabel('test5')

enter image description here

Filip.Snailer
  • 33
  • 1
  • 4

1 Answers1

6

This is because here "Age" is not an axis label, instead it is a tick. So you can add something like this:

     plt.xticks([1], [''])

to remove the first tick. And there are many other ways to remove or change ticks. For example, this post describes how to remove ticks on different axes.

Community
  • 1
  • 1
Jallyfish
  • 96
  • 3