Learn R Programming

ggsketch (version 2.0.0)

arrowhead: Build the ideal paths for one arrowhead

Description

Returns the un-roughened geometry of an arrowhead whose tip is at (tipx, tipy) and which points along angle. The grob layer roughens and paints it, so this stays pure geometry and reproduces on every device. Styles: "triangle_open" (a two-stroke V), "triangle_filled" (a solid triangle), "barb" (swept-back harpoon barbs), "fishtail" (a forked swallowtail), "dot" (a blob at the tip) and "bar" (a perpendicular tick).

Usage

arrowhead(
  tipx,
  tipy,
  angle,
  length,
  half_angle = 25 * pi/180,
  style = "triangle_open"
)

Value

A list with strokes (a list of 2-column (x, y) polylines to stroke), polygons (a list of (x, y) rings to fill) and dots

(list(x, y, r) or NULL).

Arguments

tipx, tipy

Tip position (inch space).

angle

Direction the arrow points, in radians (the end tangent).

length

Head length in inches.

half_angle

Half-angle of the wings, in radians. Default ~25 degrees.

style

One of sketch_arrowheads().

See Also

Other sketch-core: curve_fill(), engrave_fill(), engrave_ladder(), hachure_fill(), hachure_fill_multi(), leader_path(), repel_layout(), rough_arc(), rough_bezier(), rough_ellipse(), roughen_polyline(), sketch_arrowheads(), sketch_fill(), sketch_fill_multi(), spray_scatter(), stroke_profile(), stroke_ribbon(), treemap_layout(), wash_bleed(), watercolor_wash(), watercolor_wash_multi()

Examples

Run this code
arrowhead(1, 1, angle = 0, length = 0.2, style = "barb")

Run the code above in your browser using DataLab