9951 explained code solutions for 126 technologies


python-matplotlibHow to rotate x axis labels (ticks)


import matplotlib.pyplot as plt

plt.plot([2,1,3])
plt.tick_params(axis='x', labelrotation=90)
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.plot(

plot specified data

tick_params

set axis tick labels params

axis='x'

we want to update configuration for x axis only

labelrotation

sets rotation for tick labels (degrees)

.show()

render chart in a separate window