graphinglib.Stream.from_function#
- classmethod Stream.from_function(func: Callable[[ArrayLike, ArrayLike], tuple[ArrayLike, ArrayLike]], x_axis_range: tuple[float, float], y_axis_range: tuple[float, float], number_of_points_x: int = 30, number_of_points_y: int = 30, density: float | tuple[float, float] = 1, line_width: float | Literal['default'] = 'default', color: str | Literal['default'] = 'default', color_map: str | Colormap | Literal['default'] = 'default', arrow_size: float | Literal['default'] = 'default') Self [source]#
Creates a
Stream
from a function.- Parameters:
- funcCallable[[ArrayLike, ArrayLike], [ArrayLike, ArrayLike]]
Function to be plotted. Works with regular functions and lambda functions.
- x_axis_rangetuple[float, float]
Range of x values.
- y_axis_rangetuple[float, float]
Range of y values.
- number_of_points_xint
Number of points to fill the x range. Defaults to 30.
- number_of_points_yint
Number of points to fill the y range. Defaults to 30.
- densityfloat or tuple[float, float]
Density of stream lines. Can be specified independently for the x and y coordinates by specifying a density tuple instead. Defaults to 1.
- line_widthfloat
Width of the stream lines. Default depends on the
figure_style
configuration.- colorstr
Color of the stream lines. Default depends on the
figure_style
configuration.- color_mapstr or Colormap
Color map of the stream lines. Default depends on the
figure_style
configuration.- arrow_sizefloat
Arrow size multiplier. Default depends on the
figure_style
configuration.
- Returns:
- A
Stream
object from a function.
- A