Skip to content
Snippets Groups Projects
Commit 7d51bddd authored by Arnaud HEMMERLE's avatar Arnaud HEMMERLE
Browse files

Add more digits in erf/gaussian fit display.

parent 7850aea6
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@
## v3.2.0
- Solve problem of nan in energy calib.
- Add more digits in erf/gaussian fit display.
## v3.1.2
- Update LICENCE, CONTRIBUTORS, docs.
......
......@@ -584,11 +584,11 @@ def plot_gaussian_fit(
ax.tick_params(labelsize=16)
ax.yaxis.offsetText.set_fontsize(16)
if np.sign(x.min())==1:
fig.text(0.2, 0.65, 'Center %3.4g'%(lm_result.params['mu']), fontsize=14)
fig.text(0.2, 0.60, 'FWHM %3.4g'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
fig.text(0.2, 0.65, 'Center %3.4f'%(lm_result.params['mu']), fontsize=14)
fig.text(0.2, 0.60, 'FWHM %3.4f'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
else:
fig.text(0.7, 0.60, 'Center %3.4g'%(lm_result.params['mu']), fontsize=14)
fig.text(0.7, 0.55, 'FWHM %3.4g'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
fig.text(0.7, 0.60, 'Center %3.4f'%(lm_result.params['mu']), fontsize=14)
fig.text(0.7, 0.55, 'FWHM %3.4f'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
ax.set_title('Gaussian fit', fontsize=14)
if is_print_info:
......@@ -925,11 +925,11 @@ def plot_erf_fit(
ax2.yaxis.offsetText.set_fontsize(16)
ax2.tick_params(labelsize=16)
if lm_result.params['sign']>0:
fig.text(0.2, 0.65,'Center %3.4g'%(lm_result.params['mu']), fontsize=14)
fig.text(0.2, 0.60,'FWHM %3.4g'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
fig.text(0.2, 0.65,'Center %3.4f'%(lm_result.params['mu']), fontsize=14)
fig.text(0.2, 0.60,'FWHM %3.4f'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
else:
fig.text(0.7, 0.60,'Center %3.4g'%(lm_result.params['mu']), fontsize=14)
fig.text(0.7, 0.55,'FWHM %3.4g'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
fig.text(0.7, 0.60,'Center %3.4f'%(lm_result.params['mu']), fontsize=14)
fig.text(0.7, 0.55,'FWHM %3.4f'%(2.0*np.sqrt(2.0*np.log(2.))*lm_result.params['sigma']), fontsize=14)
ax.set_title('Fit with an error function', fontsize=14)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment