graphinglib.FitFromLog.from_function#
- classmethod FitFromLog.from_function(func: Callable[[TypeAliasForwardRef('ArrayLike')], TypeAliasForwardRef('ArrayLike')], x_min: float, x_max: float, label: str | None = None, color: str | Inherit = Inherit, line_width: float | Inherit = Inherit, line_style: str | Inherit = Inherit, alpha: float | Inherit = Inherit, number_of_points: int = 500) Self#
Creates a
Curvefrom a function and a range of x values.- Parameters:
- funcCallable[[ArrayLike], ArrayLike]
Function to be plotted. Works with regular functions and lambda functions.
- x_min, x_maxfloat
The
Curvewill be plotted between these two values.- labelstr, optional
Label to be displayed in the legend.
- colorstr
Color of the curve. Default depends on the
figure_styleconfiguration.- line_widthfloat
Width of the curve. Typical range is
0.5to4. Default depends on thefigure_styleconfiguration.- line_stylestr
Style of the curve. Values include
"-","--","-.",":","solid","dashed","dashdot", and"dotted". Default depends on thefigure_styleconfiguration.- alphafloat
Opacity of the curve. Range is
0(transparent) to1(opaque). Default depends on thefigure_styleconfiguration.- number_of_pointsint
Number of points to be used to plot the curve (resolution). Defaults to 500.
- Returns:
- A
Curveobject created from the given function and x range.
- A
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 between0and1((0, 0, 1)or(0, 0, 1, 0.5)).