1# Show x axes with intervals of X instead of default (this case default=5)
2import numpy as np
3import matplotlib.pyplot as plt
4
5x = [0,5,9,10,15]
6y = [0,1,2,3,4]
7X = 1.0
8plt.plot(x,y)
9plt.xticks(np.arange(min(x), max(x)+1, X))
10plt.show()
11
1import matplotlib.pyplot as plt
2
3fig, ax = plt.subplots()
4
5labels = [item.get_text() for item in ax.get_xticklabels()]
6labels[1] = 'Testing'
7
8ax.set_xticklabels(labels)
9
1#x-ticks:
2plt.xticks(start, stop, step))
3#y-ticks:
4plt.yticks(np.arange(start,stop,step))