I am working on graphics with matplotlib in Python 3.4, which represents:
x = (months) y = (12 values)
import matplotlib.pyplot as plt
import numpy as np
import calendar
N = 12
mult = 12500
x = np.arange(N)
y = mult *np.random.randn(12)
plt.plot(x, y, 'r')
plt.xticks(x, calendar.month_name[1:13], rotation=20 )
plt.yticks(y, y)
plt.grid('on')
plt.margins(0.05)
plt.show()
The signs of yticks are the values ββin y, but when some values ββare very similar, the labels overlap.
Example:

I tried the linespacing property, but it just works with every shortcut that it does not affect the set.
How do I set the spacing between labels or avoid duplication?
source
share