summaryrefslogtreecommitdiff
path: root/examples/doc_model_loadmodelresult.py
blob: 8eec5afe87e6014d592073f85bae282fc8be1b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# <examples/doc_model_loadmodelresult.py>
import matplotlib.pyplot as plt
import numpy as np

from lmfit.model import load_modelresult

data = np.loadtxt('model1d_gauss.dat')
x = data[:, 0]
y = data[:, 1]

result = load_modelresult('gauss_modelresult.sav')
print(result.fit_report())

plt.plot(x, y, 'bo')
plt.plot(x, result.best_fit, 'r-')
plt.show()
# <end examples/doc_model_loadmodelresult.py>