graphinglib.FitFromGaussian.__init__#

FitFromGaussian.__init__(curve_to_be_fit: Curve | Scatter, label: str | None = None, guesses: ArrayLike | None = None, color: str = 'default', line_width: int | Literal['default'] = 'default', line_style: str = 'default') None[source]#

Create a curve fit (continuous Curve) from an existing Curve object using a gaussian fit.

Fits a gaussian function of the form \(f(x) = A e^{-\frac{(x - \mu)^2}{2 \sigma^2}}\) to the given curve. All standard Curve attributes and methods are available.

Parameters:
curve_to_be_fitCurve or Scatter

The object to be fit.

labelstr, optional

Label to be displayed in the legend.

guessesArrayLike, optional

Initial guesses for the parameters of the fit.

colorstr

Color of the curve. Default depends on the figure_style configuration.

line_widthint

Line width of the curve. Default depends on the figure_style configuration.

line_stylestr

Line style of the curve. Default depends on the figure_style configuration.

Attributes:
amplitudefloat

Amplitude of the gaussian function.

meanfloat

Mean of the gaussian function.

standard_deviationfloat

Standard deviation of the gaussian function.

cov_matrixnp.ndarray

Covariance matrix of the parameters of the fit.

standard_deviation_of_fit_paramsnp.ndarray

Standard deviation of the parameters of the fit.

functionCallable

Gaussian function with the parameters of the fit.