import matplotlib.pyplot as plt import numpy as np def temperatur(x): return 7 - 10*np.cos(2*np.pi*x/365 - 5*np.pi/73) xarray = np.linspace(1, 365, 365) plt.plot(xarray,temperatur(xarray)) plt.xlabel('x [d]') plt.ylabel('T [C]') plt.grid() M = np.array([xarray,temperatur(xarray)]).T np.savetxt('temperatur.txt', M, fmt='%.3f',delimiter=' ') # plt.savefig('fig_plot_temp.pdf') plt.show()