I want change the x-axis ticks. I want: 0 10 20 30 40 50 ...
with pydicom.dcmread(directory) as dataset:
all_population_ages.append(dataset.PatientAge)
plt.hist(all_population_ages, histtype='bar', rwidth=0.8)
plt.xticks(np.arange(0, 100, step=10))
plt.show()
Output:
I tried this solution: Changing the "tick frequency" on x or y axis in matplotlib?
plt.xticks(np.arange(min(x), max(x)+1, 1.0))
plt.xticks(np.arange(min(all_population_ages), max(all_population_ages) + 1, 10.0))
But receive an error:
plt.xticks(np.arange(min(all_population_ages), max(all_population_ages) + 1, 10.0))
TypeError: must be str, not int
Thanks in advance for any assistance.