Function to add borders and labels to an existing figure.

draw_borders_and_labels(
  xl,
  yl,
  labels = c("X-axis", "Y-axis", "Title", ""),
  sides = 1:2,
  lwd = 2,
  lines = 1.5,
  cex = 1.15
)

Arguments

xl

The lower and upper boundaries for the x-axis.

yl

The lower and upper boundaries for the y-axis.

labels

A character vector of up to 4 elements, the labels for the bottom, left, top, and right sides, respectively. If fewer than 4 elements are given, the corresponding labels are set to the empty character string.

sides

An integer vector of up to four values ranging from 1 to 4, specifying the sides at which to draw a border. The values 1, 2, 3, and 4 indicate the bottom, left, top, and right sides, respectively.

lwd

A numeric vector of up to 4 values, the width of the lines (see par). Values are recycled if the length is less than 4.

cex

A numeric vector of up to 4 values, the size of the text for the labels (see par). Values are recycled if the length is less than 4.

Value

Adds borders and labels to an existing figure.

Examples

# Create a blank plot
xl <- 0:1; yl <- 0:1
plot_blank( xl, yl )

# Add borders and labels
draw_borders_and_labels( xl, yl )