I have two arrays that i am graphing like this
dates = [datetime.date(2015, 11, 22), datetime.date(2015, 11, 23), datetime.date(2015, 11, 24)]
points = [3L, 1L, 2L]
And then I plot like this
plt.plot(dates, points, 'r-o')
plt.xticks(rotation=70)
plt.tight_layout()
plt.savefig('test.pdf')
Which produces a graph like this

But i don't want the times to appear, I want to dates to appear and I have an array of dates, not date times or times, so what is the x axis showing times?
How can I get it to be like this on the x axis 2015-11-22, 2015-11-23, 2015-11-24?

Try this :
dates = [datetime.date(2015, 11, 22), datetime.date(2015, 11, 23), datetime.date(2015, 11, 24)]
points = [3L, 1L, 2L]
x = [x for x in range(0,len(points))]
plt.plot(points, 'r-o')
plt.xticks(rotation=70)
plt.xticks(x,dates)
plt.tight_layout()
plt.savefig('test.pdf')
I hope it's help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With