A general approach is to tell matplotlib the desired number of ticks:
plt.locator_params(nbins=10)
Edit by comments from @Daniel Power: to change for a single axis (e.g. 'x'
) on an axis, use:
ax.locator_params(nbins=10, axis="x")
A general approach is to tell matplotlib the desired number of ticks:
plt.locator_params(nbins=10)
Edit by comments from @Daniel Power: to change for a single axis (e.g. 'x'
) on an axis, use:
ax.locator_params(nbins=10, axis="x")