I\'m using matplotlib to generate a diagram, and I use set_ticks and set_ticklabels to mark out several important values on the x-axis. But some of
As a strict response to the question asked, you can get the specific tick and use set_pad()
ax.get_xaxis().majorTicks[2].set_pad()
I think that a better practice would be to use autofmt_xdate
fig = plt.figure()
fig.autofmt_xdate()
Which rotates the xtick labels nicely and allow most texts to fit nicely without overlapping.
If they still overlap - it means that those ticks are very close together. And then the question which arises is what good would two ticks so closely together would do to the viewer of your plot?