Skip to content

Commit

Permalink
fix bug of plot API
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjinliu committed May 12, 2024
1 parent 41cf96c commit a4468ca
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions whitecanvas/canvas/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,39 @@ def add_vectors(
alpha: float = 1.0,
antialias: bool = True,
) -> _l.Vectors:
"""
Add a vector field to the canvas.
>>> canvas.add_vectors(x, y, vx, vy)
Parameters
----------
x : array-like
X coordinates of the vectors.
y : array-like
Y coordinates of the vectors.
vx : array-like
X components of the vectors.
vy : array-like
Y components of the vectors.
name : str, optional
Name of the layer.
color : color-like, optional
Color of the bars.
width : float, optional
Line width. Use the theme default if not specified.
style : str or LineStyle, optional
Line style. Use the theme default if not specified.
alpha : float, default 1.0
Alpha channel of the line.
antialias : bool, default True
Antialiasing of the line.
Returns
-------
Vectors
The vectors layer.
"""
name = self._coerce_name(name)
color = self._generate_colors(color)
width = theme._default("line.width", width)
Expand Down

0 comments on commit a4468ca

Please sign in to comment.