## examples/fitting/doc_example_fitpeak1.lar
# create mock data
x = linspace(0, 100, 51)
noise = random.normal(size=len(x), scale=0.1)
y = 8.0 - x*0.025 + noise
y = y + voigt(x, amplitude=89.0, center=44.25, sigma=4.75, gamma=2.0)

# fit to Gaussian with linear background
myfit = fit_peak(x, y, 'gaussian', background='linear')

plot(myfit.x, myfit.y, marker='+', label='data',
     xlabel='x', ylabel='y', show_legend=True, new=True)
plot(myfit.x, myfit.fit_init, label='init')
plot(myfit.x, myfit.fit, label='best fit')

print( fit_report(myfit, min_correl=0.3))

## end examples/fitting/doc_example_fitpeak1.lar
