mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-16 15:20:24 +01:00
docstring for Corr.show extended, bug for display of fit result fixed
This commit is contained in:
parent
7e909affcc
commit
61cd8d9415
1 changed files with 16 additions and 6 deletions
|
@ -490,15 +490,25 @@ class Corr:
|
||||||
self.prange = prange
|
self.prange = prange
|
||||||
return
|
return
|
||||||
|
|
||||||
def show(self, x_range=None, comp=None, y_range=None, logscale=False, plateau=None, fit_res=None, save=None, ylabel=None):
|
def show(self, x_range=None, comp=None, y_range=None, logscale=False, plateau=None, fit_res=None, ylabel=None, save=None):
|
||||||
"""Plots the correlator, uses tag as label if available.
|
"""Plots the correlator, uses tag as label if available.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
x_range -- list of two values, determining the range of the x-axis e.g. [4, 8]
|
x_range : list
|
||||||
comp -- Correlator or list of correlators which are plotted for comparison.
|
list of two values, determining the range of the x-axis e.g. [4, 8]
|
||||||
logscale -- Sets y-axis to logscale
|
comp : Corr or list of Corr
|
||||||
save -- path to file in which the figure should be saved
|
Correlator or list of correlators which are plotted for comparison.
|
||||||
|
logscale : bool
|
||||||
|
Sets y-axis to logscale
|
||||||
|
plateau : Obs
|
||||||
|
plateau to be visualized in the figure
|
||||||
|
fit_res : Fit_result
|
||||||
|
Fit_result object to be visualized
|
||||||
|
ylabel : str
|
||||||
|
Label for the y-axis
|
||||||
|
save : str
|
||||||
|
path to file in which the figure should be saved
|
||||||
"""
|
"""
|
||||||
if self.N != 1:
|
if self.N != 1:
|
||||||
raise Exception("Correlator must be projected before plotting")
|
raise Exception("Correlator must be projected before plotting")
|
||||||
|
@ -544,7 +554,7 @@ class Corr:
|
||||||
if fit_res:
|
if fit_res:
|
||||||
x_samples = np.arange(x_range[0], x_range[1] + 1, 0.05)
|
x_samples = np.arange(x_range[0], x_range[1] + 1, 0.05)
|
||||||
ax1.plot(x_samples,
|
ax1.plot(x_samples,
|
||||||
fit_res['fit_function']([o.value for o in fit_res['fit_parameters']], x_samples),
|
fit_res.fit_function([o.value for o in fit_res.fit_parameters], x_samples),
|
||||||
ls='-', marker=',', lw=2)
|
ls='-', marker=',', lw=2)
|
||||||
|
|
||||||
ax1.set_xlabel(r'$x_0 / a$')
|
ax1.set_xlabel(r'$x_0 / a$')
|
||||||
|
|
Loading…
Add table
Reference in a new issue