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 |
inset |
A |
indent , outdent |
A |
height |
A |
lineend |
A |
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
-
arrow_head_wings()
: Places two triangles at either side of the line. Let ABC be a triangle, where A is at the end of the line, B is on the line and C is the arrow wingtip. Thenoffset
is the angle at corner A andinset
is the angle at corner C. -
arrow_fins_feather()
: Places trapezoids at either side of the line. Let ABCD be a quadrilateral shape, where A is at the end of the line, B is on the line, and CD is parallel to AB, but offset from the line. Then,indent
is the distance along the line between A and D andoutdent
is the distance along the line between B and C. -
arrow_head_line()
: A line as an arrow head. -
arrow_fins_line()
: A line as an arrow fin. -
arrow_cup()
: A curved line some fixed distance away from the point to be resected, resembling a 'cup' shape. -
arrow_head_minimal()
: This is a 'fake' arrow head who in practice doesn't draw anything, but sets thenotch_angle
attribute such that the arrow shaft is whittled into a triangular point. -
arrow_fins_minimal()
: This is a 'fake' arrow head who in practise doesn't draw anything, but sets thenotch_angle
attribute such that a triangle is taken out of the arrow shaft.
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")