I am trying to use matplotlib to graph stock prices against a datetime index.
So I have a graph that looks like this:
And I need it to look like this:
I think it might have something to do with xticks, but I cannot figure out how to make xticks work with a datetime index. Thanks for the help.
tesla['Open'].plot(title='Open Price', label = 'Tesla', figsize = (16, 6))
ford['Open'].plot(label = 'ford')
gm['Open'].plot(label = 'GM')
plt.legend()
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y'))