graphinglib.VectorField.__init__#
- VectorField.__init__(x_data: ArrayLike, y_data: ArrayLike, u_data: ArrayLike, v_data: ArrayLike, arrow_width: float | Inherit = Inherit, arrow_head_size: float | Inherit = Inherit, scale: float | None = None, make_angles_axes_independent: bool = False, color: str | Inherit = Inherit) 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. Typical range is
0.5to4. Default depends on thefigure_styleconfiguration.- arrow_head_sizefloat
Size of the arrow head. Acts as a multiplier for the standard arrow head size. Typical range is
0.5to4. Default depends on thefigure_styleconfiguration.- scalefloat
Scaling of the arrow lengths. If
None, the arrows will be automatically scaled to look nice. Use 1 for no scaling. Default isNone.- 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. IfFalse, the vectors will scale with the aspect ratio of the axes. Defaults toFalse.- colorstr
Color of the vector arrows. Default depends on the
figure_styleconfiguration.
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)).