arrow_ornaments {ggarrow}R Documentation

Arrow ornament functions

Description

There are two types of arrow ornament functions: functions for arrow heads, and functions for arrow fins. The heads and fins can be used interchangeably, but the name makes it clearer what is suitable.

Usage

arrow_head_wings(offset = 20, inset = 30)

arrow_fins_feather(indent = 0.3, outdent = indent, height = 0.5)

arrow_head_line(angle = 30, lineend = "butt")

arrow_fins_line(angle = 30, lineend = "butt")

arrow_cup(lineend = "round", angle = NULL)

arrow_head_minimal(angle = 45)

arrow_fins_minimal(angle = 45)

Arguments

offset, angle

A numeric(1) giving an angle in degrees for the angle between the line and tip.

inset

A numeric(1) giving an angle in degrees for the angle inside the tip of the arrowhead.

indent, outdent

A numeric(1) giving the fraction of the feather feather length to offset the notch and the end respectively.

height

A numeric(1) ratio between the length of the feathers and the height of the feathers.

lineend

A character(1), one of "butt", "square", "round" or "parallel". For arrow_cup(), only "butt" and "round" are allowed.

Details

The convention for these functions is that the arrow shaft is fused to the ornament at the (0,0) point and the ornaments ends at the (1,0) point.

Value

A ⁠<matrix[n, 2]>⁠ with x and y columns describing a polygon. It has a notch_angle attribute that is used fusing the fins/head to the shaft of the arrow. They can be given to an arrow plotting function.

Functions

Examples

# Plotting winged head
plot(c(-0.5, 1), c(-0.6, 0.6), type = "n")
polygon(arrow_head_wings(), col = "gray")

# Plotting feather fins
plot(c(0, 1), c(-0.25, 0.25), type = "n")
polygon(arrow_fins_feather(), col = "gray")

[Package ggarrow version 0.1.0 Index]