fig, ax = plt.subplots(figsize=(4, 2.5)) ax.plot(np.arange(10)) ax.tick_params(top=True, labeltop=True, color='red', axis='x', labelcolor='green')