Jun-21-2017, 10:23 PM
You do not convert your
Morever even with correct converting you would plot only last bar (you are not keeping older values). And with that strange way to convert datetime to matplotlib dates through string and loadtxt you are discarding time part of timestamp, so you could end with hundreds of bars with same date. Perhaps better way is to use something like
You probably should split your function and have one function to convert downloaded data and second one to plot.
date
to matplotlib dates, value of your date is 20170608?, plt.plot_date takes it as number of days from 1.1.1, that is 55224 years, out of range of python datatetime.Morever even with correct converting you would plot only last bar (you are not keeping older values). And with that strange way to convert datetime to matplotlib dates through string and loadtxt you are discarding time part of timestamp, so you could end with hundreds of bars with same date. Perhaps better way is to use something like
matplotlib_date = mdates.date2num(datetime.fromtimestamp(day + 240 * offset))to convert posix timestamp to matplotlib date (real number where fractional part represents part of day).
You probably should split your function and have one function to convert downloaded data and second one to plot.