Line
Line
Bases: DrawingObject
A class to create lines in the tikz environment.
The Line
class helps handle the creation of lines in tikz code. It is analagous to the TikZ code
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
Union[Tuple[float, float], Point]
|
Pair of floats representing the start of the line |
required |
end |
Union[Tuple[float, float], Point]
|
Pair of floats representing the end of the line |
required |
options |
str
|
String containing Tikz drawing options, e.g. "Blue" |
''
|
control_pts |
List[Tuple]
|
List of control points for the line |
[]
|
pos_at_t
Returns the point on the line that lies at "time t", on a scale from 0 to 1.
rotate
Rotate start, end, and control_pts. By default, the rotation is done relative to the midpoint of the line.
Examples
Here's an example of us using the Line
class.
import tikzpy
tikz = tikzpy.TikzPicture()
tikz.line((0, 0), (4, 0), options="->", control_pts=[(1, 1), (3, -1)]
