matplotlib set number of ticks code example
Example 1: matplotlib limit number of ticks
plt.xaxis.set_major_locator(plt.MaxNLocator(3))
plt.yaxis.set_major_locator(plt.MaxNLocator(3))
Example 2: matplotlib custom ticks
axis.set_yticks([0.5,0.6,0.7,0.8,0.9,1.0])