graphinglib.VectorField.__init__#

VectorField.__init__(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') None[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. Default is None.

make_angles_axes_independentbool

Whether to use the screen coordinates or the data coordinates to determine the vector directions. If True, vectors with u = v will always appear as 45 degree angles with respect to the screen, regardless of the axes limits. If False, the vectors will scale with the aspect ratio of the axes. Defaults to False.

colorstr

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