matplotlib plot x axis too many labels in r\ 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))