graphinglib.VectorField#

class graphinglib.VectorField(x_data: ArrayLike, y_data: ArrayLike, u_data: ArrayLike, v_data: ArrayLike, arrow_width: float | Literal['default'] = 'default', arrow_head_size: float | Literal['default'] = 'default', scale: float | None = None, make_angles_axes_independent: bool = False, color: str | Literal['default'] = 'default')[source]#

This class implements vector fields.

Parameters:
x_data, y_dataArrayLike

x and y coordinates of the vectors.

u_data, v_dataArrayLike

Magnitudes in the x and y coordinates.

arrow_widthfloat

Width of the arrow shaft. Acts as a multiplier for the standard arrow width. Default depends on the figure_style configuration.

arrow_head_sizefloat

Size of the arrow head. Acts as a multiplier for the standard arrow head size. Default depends on the figure_style configuration.

scalefloat

Scaling of the arrow lengths. If None, the arrows will be automatically scaled to look nice. Use 1 for no scaling.

angle_in_data_coordsbool

Wheter to use the screen coordinates or the data coordinates to determine the vector directions. Defaults to True.

colorstr

Color of the vector arrows. Default depends on the figure_style configuration.

Methods

__init__(x_data, y_data, u_data, v_data[, ...])

This class implements vector fields.

copy()

Returns a deep copy of the VectorField.

from_function(func, x_axis_range, y_axis_range)

Creates a VectorField from a function.