import matplotlib.pyplot as plt
import numpy as np

data = np.loadtxt('SN_m_tot_V2.0.txt')
x = data[:,2]
y = data[:,3]
plt.figure(figsize=(15, 3))
plt.xticks(range(1700, 2020, 10))
plt.plot(x, y, 'o')
plt.xlabel('cas [rok]')
plt.ylabel('Wolfovo cislo')
plt.show()

# Dlzku cyklu urobime spriemerovanim za celu dobu pozorovani tak, ze urobime
# odhady prveho a posledneho jasneho maxima.
time2 = 2014
time1 = 1762
n = 24
print('Hlavny slnecny cyklus ma periodu {} rokov.'.format((time2 - time1)/n))
