Code Example:
import matplotlib.pyplot as plt
xs = [0, 5, 9, 10, 15]
ys = [0, 1, 2, 3, 4]
plt.plot(xs, ys)
plt.xticks([x for x in range(max(xs) + 1) if x % 2 == 0]) # x标记step设置为2
plt.yticks([y for y in range(max(ys) + 1)]) # y标记step设置为1
plt.show()
Ref
http://stackoverflow.com/questions/12608788/changing-the-tick-frequency-on-x-or-y-axis-in-matplotlib