import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as md
import datetime as dt
import time

fig, ax = plt.subplots()
data_ = np.loadtxt("trenovaci_dva_tydny_.txt")
data = None
for i in range(0,data_.shape[0], 50):
	if data is None:
		data = data_[i,:]
	else:
		data = np.vstack([data,data_[i,:]])
times = data[:,0]
dates=[dt.datetime.fromtimestamp(ts) for ts in times]
xfmt = md.DateFormatter('%Y-%m-%d')
ax.xaxis.set_major_formatter(xfmt)
ax.scatter(dates, data[:,1], label="data", s=2)
plt.subplots_adjust(bottom=0.25)
#ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))
ax.grid(axis="both")
xt = None
xt = np.arange(np.min(times),np.max(times)+86399,86400)
xt = xt - np.mod(xt, 86400)
ax.xaxis.set_ticks([dt.datetime.fromtimestamp(ts) for ts in xt])
plt.xticks(rotation=90)
plt.xlim(dt.datetime.fromtimestamp(np.min(xt)), dt.datetime.fromtimestamp(np.max(xt)))
ax.set_ylabel('x-ová souřadnice')
#ax.set_title('Úloha s chodci: Trénovací sada (výběr)')
plt.show()

