Skip to contents

Draws a line along an axis edge, with style defaults taken from the axis.line element of the set theme. Requires coord_cartesian(clip = "off").

Usage

axis_line(
  ...,
  position = NULL,
  xintercept = NULL,
  yintercept = NULL,
  colour = NULL,
  linewidth = NULL,
  linetype = NULL
)

Arguments

...

Not used. Forces named arguments.

position

One of "top", "bottom", "left", or "right". Inferred from xintercept or yintercept if not provided.

xintercept

For "left"/"right" axes: float the axis to this x position in data coordinates instead of the panel edge.

yintercept

For "top"/"bottom" axes: float the axis to this y position in data coordinates instead of the panel edge.

colour

Inherits from axis.line in the set theme.

linewidth

Inherits from axis.line in the set theme. Supports rel().

linetype

Inherits from axis.line in the set theme.

Value

A list of ggplot2 annotation layers.