Draws horizontal or vertical lines on an existing figure.

draw_hv(h = NULL, v = NULL, l = NULL, ...)

Arguments

h

A vector with the y-axis positions for horizontal lines.

v

A vector with the x-axis positions for vertical lines.

l

The lower and upper coordinates to determine the length of the line (if y is not NULL, l is taken as the x-axis coordinates; if x is not NULL, l is taken as the y-axis coordinates).

...

Additional arguments to be passed to the segments function.

Examples

# Create a blank plot
plot_blank()

# Draw horizontal line
draw_hv(h = .5, lty = 2)
# Draw vertical line
draw_hv(v = .5, lwd = 2)

# Control width of horizontal line
draw_hv(h = .25, l = c(.25, .75), col = "blue")
# Control height of vertical line
draw_hv(v = .25, l = c(.25, .75), col = "orange")