Export

fit.csv and fit.png.

np.savetxt and plt.savefig land on the file chips.

Goal

Write fit.csv and fit.png.

x = np.linspace(0, 1, 5)
np.savetxt('fit.csv', np.column_stack([x, 2 * x + 1]), delimiter=',', header='x,y', comments='')
print(open('fit.csv').read())
x = np.linspace(0, 2 * np.pi, 80)
plt.plot(x, np.sin(x))
plt.savefig('fit.png', dpi=120, bbox_inches='tight')
plt.show()
print('wrote fit.png')