Étiquettes centrales Histogramme matplotlib
n, bins, patches = plt.hist(x, bins=n_bins, edgecolor='black')
ticks = [(patch._x0 + patch._x1)/2 for patch in patches]
ticklabels = [i for i in range(n_bins)]
plt.xticks(ticks, ticklabels)
Chunxiao Wang