how to rotate labels in matplotlib code example
Example 1: rotate axis labels matplotlib
plt.xticks(rotation=90)
Example 2: rotate labels matplotlib
xticks(rotation=45) # rotate x-axis labels by 45 degrees.
yticks(rotation=90) # rotate y-axis labels by 90 degrees.
Example 3: rotate xticks matplotlib
# rotate xticks of a plot Matplotlib
angle = 90
plt.xticks(rotation=angle)