I'm trying to visualize a histogram of when individuals had been contacted in a marketing campaign,
The data has values for all months, ranging from Jan to Dec, represented as 1 to 12 in the dataset.
I have the following code which I'm using to generate a the histogram but the x ticks & x tick labels refuse to cooperate,
df['month'].hist()
plt.ylabel('Number of contacts')
plt.xlabel('Month contacted in current campaign')
plt.xticks(ticks = [1,2,3,4,5,6,7,8,9,10,11,12], labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
#ax.set_xticklabels(months,rotation=45, rotation_mode="anchor", ha="right")
plt.show()
Which is returing this chart, however, the x ticks aren't coming across as giving each month it's non-numerical label (Jan, Feb, Mar, etc.)