import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(2, 1, 1)
ax.set_xlabel('X-Label', fontsize=10, color='red')
plt.setp(ax.get_xticklabels(), visible=False)
Python hide ticks but show tick labels