You set the set_xticks counter (and values) with set_xticks . You set set_xticklabels text with set_xticklabels
from matplotlib import pyplot as plt plt.plot([1,2,3],[3,4,3]) ax = plt.gca() ax.set_xticks([1,2,3]) ax.set_xticklabels(['1/1','1/2','1/3'])
source share