Rotating custom tick labels — Matplotlib 3.7.1 documentation
https://matplotlib.org/stable/gallery/ticks/ticklabels_rotation.html
Webimport matplotlib.pyplot as plt x = [1, 2, 3, 4] y = [1, 4, 9, 6] labels = ['Frogs', 'Hogs', 'Bogs', 'Slogs'] plt. plot (x, y) # You can specify a rotation for the tick labels in degrees or with keywords. plt. xticks (x, labels, rotation = 'vertical') # Pad margins so that markers don't get clipped by the axes plt. margins (0.2) # Tweak spacing ...
DA: 83 PA: 19 MOZ Rank: 83