The result is:
This page shows the better way to chose numbers of x and y ticklabels.
%matplotlib inline
import matplotlib.pyplot as plt
x = [0,2,5,9,10]
y = [0,1,2,3,4.5]
plt.plot(x,y,'o-')
plt.show()
plt.plot(x,y,'o-')
plt.xticks(x,x)
plt.yticks(y,y)
plt.show()
fig, ax = plt.subplots()
ax.plot(x,y,'o-')
ax.set_xticks(x)
ax.set_yticks(y)
plt.show()