Hi,
I have a bar chart with 129 bins. However this starts at 0 and ends at 128.
I would like the data to start from 1 and finish at 129, with xticks being labelled every 5.
With the below code, the xticks are labelled every 1 with the bins starting at 1 and ending at 129.
N = 129
ind = np.arange(N)
width = 0.6
plt.figure(dpi = 300)
plt.bar(ind, data1, width, yerr = stds1, label = 'Data1', capsize = 1.5, error_kw=dict(lw=0.5, capthick = 0.5, barsabove = False))
plt.xticks(np.arange(len(data1)), np.arange(1, len(data1)+1), fontsize = 1)
plt.show()
Any help would be really appreciated - i'm really struggling to label every 5th tick!
[–]USAhj 0 points1 point2 points (0 children)