graphinglib.FitFromLog.__init__#

FitFromLog.__init__(curve_to_be_fit: Curve | Scatter, label: str | None = None, log_base: float = 2.718281828459045, guesses: TypeAliasForwardRef('ArrayLike') | None = None, color: str | Inherit = Inherit, line_width: int | Inherit = Inherit, line_style: str | Inherit = Inherit, alpha: float | Inherit = Inherit, max_iterations: int = 10000) None[source]#

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

Fits a logarithmic function of the form \(f(x) = a \log_{base}(x + b) + c\) 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.

log_basefloat

Base of the logarithm. Default is e.

guessesArrayLike, optional

Initial guesses for the parameters of the fit. Order is a, b, c as written above.

colorstr

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

line_widthint

Line width of the curve. Typical range is 0.5 to 4. Default depends on the figure_style configuration.

line_stylestr

Line style of the curve. Values include "-", "--", "-.", ":", "solid", "dashed", "dashdot", and "dotted". Default depends on the figure_style configuration.

alphafloat

Opacity of the curve. Range is 0 (transparent) to 1 (opaque). Default depends on the figure_style configuration.

max_iterationsint

Maximum number of iterations for the fit. Default is 10000.

Attributes:
parametersnp.ndarray

Parameters of the fit (same order as guesses).

cov_matrixnp.ndarray

Covariance matrix of the parameters of the fit.

standard_deviationnp.ndarray

Standard deviation of the parameters of the fit.

functionCallable

Logarithmic function with the parameters of the fit.

Notes

Color parameters accept Matplotlib color formats: named colors ("blue"), short color strings ("b"), hex strings ("#0000ff"), grayscale strings ("0.5"), and RGB/RGBA tuples with values between 0 and 1 ((0, 0, 1) or (0, 0, 1, 0.5)).