Pens and Arrows
Pens
Colors are stored in a NamedColor
.
AsyPlots.NamedColor
— Type.NamedColor(name::String,color::RGB)
A named ColorTypes.RGB
Examples
julia> NamedColor("DarkGreen")
NamedColor("DarkGreen",(0.0, 0.39, 0.0))
The second argument may be omitted, in which case Colors.parse
is used to map the specified string to an appropriate RGB triple. The RGB
triple is used for the Cairo backend, while only the name
is passed to Asymptote (unless name == ""
, in which case the RGB triple is used). Both Asymptote and Colors.jl
will correctly handle the X11 named colors.
Options for plotting (color, line width, opacity, and font size) are specified using a Pen
object.
AsyPlots.Pen
— Type.Pen(color::NamedColor,
opacity::Real,
linewidth::Real,
other::String)
Store drawing properties
Examples
julia> Pen(color="DarkGreen",opacity=0.5)
Pen(color=DarkGreen,opacity=0.5)
The function NoPen()
returns a pen which specifies no drawing. This may be used, for example, as the fillpen
for a polygon which should not be filled in.
Arrows
Each Path2D
or Path3D
object has an arrow
field for specifying how an arrow should be drawn on the path. A default arrow in 2D/3D can be created using Arrow()
/Arrow3()
.
AsyPlots.Arrow
— Type.Arrow(name::AbstractString,
size::Real,
position::Real)
Store instructions for drawing an arrow
position
is an element of [0,1] which indicates how far along the path the arrow should be drawn
NoArrow() returns a no-arrow instruction, while Arrow3() gives an arrow suitable for 3D paths