rotate x label by 45 degrees matplotlib python code example Example: matplotlib x label rotation plt.xticks(rotation=45)