graphinglib.FitFromSquareRoot.from_function#

classmethod FitFromSquareRoot.from_function(func: Callable[[ArrayLike], ArrayLike], x_min: float, x_max: float, label: str | None = None, color: str = 'default', line_width: float | Literal['default'] = 'default', line_style: str = 'default', number_of_points: int = 500) Self#

Creates a Curve from 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 Curve will 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_style configuration.

line_widthfloat

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

number_of_pointsint

Number of points to be used to plot the curve (resolution). Defaults to 500.

Returns:
A Curve object created from the given function and x range.