2D Plots

2D Plots

Each of the following 2D graphics primitives has an alternative constructor without the 2D at the end.

Point2D(x::Real,y::Real; label="",pen=Pen())
Point2D(P; label="",pen=Pen())

A graphics primitive representing a two-dimensional point.

P may be a 2-tuple of real numbers, a Vec2, or a Complex

Examples

julia> Point2D(3,-1;pen="DarkGreen")
Point2D(3,-1;pen=DarkGreen)
source
AsyPlots.Path2DType.
Path2D(points;label="",pen=Pen(),arrow=NoArrow(),spline=false)
Path2D(x,y;label="",pen=Pen(),arrow=NoArrow(),spline=false)

A graphics primitive representing a two-dimensional path

points may be an Array of Vec2s, an Array of 2-tuples, or an $n × 2$ Array. Alternatively, iterables of coordinates may be supplied separately as x and y

Examples

julia> Path2D([(0,0),(1,0),(1,1)];pen="MidnightBlue")
Path2D(<3 points>;pen=MidnightBlue)
source
Circle2D(center,radius; pen::Pen,fillpen::Pen)

A graphics primitive representing a circle in the plane

center may be a Vec2 or a 2-tuple of Reals or a Complex

Examples

julia> Circle2D((0,0),1;pen="LightBlue",fillpen="red")
Circle2D((0,0),1;pen=LightBlue,fillpen=red)
source
Polygon2D(points;pen=Pen(),
                 fillpen=Pen(color="white"),
                 spline=false)

A graphics primitive representing a two-dimensional polygon

points may be an Array of Vec2s, an Array of 2-tuples, or an $n × 2$ Array. Alternatively, iterables of coordinates may be supplied separately as x and y

Examples

julia> Polygon2D([(0,0),(1,0),(1,1)];pen="MidnightBlue")
Polygon2D(<3 points>;pen=MidnightBlue)
source
RawString(s::AbstractString)

Container for directly inserting Asymptote drawing commands

Examples

julia> Plot([Circle((0,0),1),RawString2D("draw((0,0)--dir(20));")])
source