Xelabel can be colored during customization,
ax.set_xlabel("x-label", color="red")
To set the color of the tag label, you can use tick_params , which sets the tag labels, as well as the color of ticks.
ax.tick_params(axis='x', colors='red')

Alternatively, plt.setp can only be used to set the color of shortcuts without changing the color of the ticks.
plt.setp(ax.get_xticklabels(), color="red")

Note that to change properties along the y axis, you can replace x with y in the above.
ImportanceOfBeingErnest
source share