# Hide axis if it is outer plt.gca().label_outer() # Or, hide any axis plt.setp(plt.gca().get_xticklabels(), visible=False)