import numpy as np import matplotlib.pyplot as plt def solhoyde(x): return 23 - 20*np.cos(np.pi*x/12) xarray = np.linspace(0, 23, 24) M = np.array([xarray, solhoyde(xarray)]).T np.savetxt('solhoyde.txt', M, fmt='%.3f',delimiter=' ') plt.close('all') plt.plot(xarray, solhoyde(xarray)) plt.xlabel('Tid i doegnet, x [time]') plt.ylabel('Solhoyde, h(x) [grader]') plt.grid() # plt.savefig('plott_solhoyde.pdf') plt.show()