graphinglib.FitFromSine.__init__#
- FitFromSine.__init__(curve_to_be_fit: Curve | Scatter, label: str | None = None, guesses: ArrayLike | None = None, color: str = 'default', line_width: str = 'default', line_style: str = 'default') None [source]#
Create a curve fit (continuous
Curve
) from an existingCurve
object using a sinusoidal fit.Fits a sine function of the form \(f(x) = a sin(bx + c) + d\) to the given curve. All standard
Curve
attributes and methods are available.- Parameters:
- curve_to_be_fit
Curve
orScatter
The object to be fit.
- labelstr, optional
Label to be displayed in the legend.
- guessesArrayLike, optional
Initial guesses for the parameters of the fit (order: amplitude (a), frequency (b), phase (c), vertical shift (d) as written above).
- 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.
- curve_to_be_fit
- Attributes:
- amplitudefloat
Amplitude of the sine function.
- frequency_radfloat
Frequency of the sine function in radians.
- frequency_degfloat
Frequency of the sine function in degrees.
- phase_radfloat
Phase of the sine function.
- phase_degfloat
Phase of the sine function in degrees.
- vertical_shiftfloat
Vertical shift of the sine function.
- parametersnp.ndarray
Parameters of the fit (amplitude, frequency (rad), phase (rad), vertical shift)
- cov_matrixnp.ndarray
Covariance matrix of the parameters of the fit.
- standard_deviationnp.ndarray
Standard deviation of the parameters of the fit.
- functionCallable
Sine function with the parameters of the fit.