How to plot a chart with minor grid of 1, major grid of 10, and with xticklabels increment 20 units?
Here is my sample code and output with xticklabels increment every 10 units:
plt.figure(figsize=(10, 10))
ax = plt.gca()
major_ticks = np.arange(0, 60, 10)
minor_ticks = np.arange(0, 60, 1)
ax.set_xticks(major_ticks)
ax.set_xticks(minor_ticks, minor=True)
ax.set_yticks(major_ticks)
ax.set_yticks(minor_ticks, minor=True)
ax.grid(which='major')
ax.grid(which='minor', alpha=0.5)
ax.set_aspect('equal')
But then I wanted to display the xticklabels and yticklabels with the increment of 20 instead of 10, as shown here like this:
Any idea how to accomplish this? Thanks