matplotlib don't show all ticks code example
Example: matplotlib limit number of ticks
plt.xaxis.set_major_locator(plt.MaxNLocator(3))
plt.yaxis.set_major_locator(plt.MaxNLocator(3))
plt.xaxis.set_major_locator(plt.MaxNLocator(3))
plt.yaxis.set_major_locator(plt.MaxNLocator(3))