I'm trying to get my label on the x axis between the ticks. Previous answers to this question, linked below, are not helping me.
My approach so far has been to force it manually using this code:
x = np.arange(1,365,step=30)
my_xticks =['Jan','Feb','March','April','May','June','July','Aug','Sep','Oct','Nov','Dec']
plt.xticks(x, my_xticks)
which nearly gives me the results:
but the problem is the months are at the tick, and I need them to be between ticks.
Using my current method, how can I get the months to be in between each tick?
Previous answers to this question, here and here make use of matplotlib.axes.Axes.set_xticks. The trick in these answers seems to be to declare fig, ax = subplots()
, and then access the axes where it is possible to adjust the alignment. My problem is that I have created the chart using only fig = plt.figure()
and I don't know how to access the axes. When I tried to add ax = plt.subplots()
it seemed to reset the whole project and the chart became unreadable.
If there is any guidance on both these problems I'd be grateful.