I've been on here all day trying to figure out how I can change the tick labels on the x-axis. I'm exclusively working with large financial time series, so I can't just create small little tick lists. If possible I'd like the axis to show, for example, March 2016 (or Mar 16) instead of 03-2016.
I'd like to write something that is easy to understand (I'm a python noob), and that I can easily copy->paste->manipulate for different datasets. For example, is it possible to label every other tick (or every 4 ticks etc etc)?
Here's what I have so far:
years = mdates.YearLocator()
months = mdates.MonthLocator()
days = mdates.DayLocator()
fmt = mdates.DateFormatter('%Y')
fig, ax = plt.subplots(figsize = (20,10))
x = SP500_Futures_Net_Positioning1.index
y = SP500_Futures_Net_Positioning1[0]
ax.bar(x,y,width = 10, color = 'deepskyblue')
ax.xaxis.set_major_locator(years)
ax.xaxis.set_minor_locator(months)
ax.xaxis.set_major_formatter(fmt)
ax.grid(False)
plt.show()
If you know any good tutorials on this please send them my way.
Thanks everyone!!