I have a plot in which I have to divide my data points into several groups, so I made customized sticks for this plot.
For instance, I have to group data points into multiples of 12, this is what I did
my_xticks = []
for x_ele in range(len(all_points)):
if x_ele % 12 == 0:
my_xticks.append(x_ele//12 + 1)
else:
my_xticks.append('')
ax.set_xticks(range(len(my_xticks)))
ax.set_xticklabels(my_xticks)
And the x-axis of the plot looks as
However, I wish to remove those spikes with empty labels, as circled in red
So the final x-axis could look like
Any idea? Thanks!