annotate_axis_line: Replace a axis line with an annotated segment

View source: R/annotate_axis_line.R

annotate_axis_lineR Documentation

Replace a axis line with an annotated segment

Description

Replace a axis line with an annotated segment, so that geom features are in front of it.

Usage

annotate_axis_line(
  axis = "x",
  ...,
  x_position = "bottom",
  y_position = "left",
  colour = NULL,
  linewidth = NULL
)

Arguments

axis

The axis. Either "x" or "y"

...

Extra parameters passed to ggplot2::annotate("segment", ...).

x_position

The position of the "x" axis, if applicable. Either "bottom" or "top".

y_position

The position of the "y" axis, if applicable. Either "left" or "right".

colour

The colour of the annotated segment.

linewidth

The linewidth of the annotated segment.

Value

A list of a annotate layer and theme elements.

Examples

library(dplyr)
library(ggplot2)
library(ggblanket)
library(palmerpenguins)

set_blanket()

penguins |>
  add_row(
    flipper_length_mm = 175,
    body_mass_g = 2500,
    species = "Adelie",
  ) |>
  gg_blanket(
    x = flipper_length_mm,
    y = body_mass_g,
    col = species,
  ) +
  annotate_axis_line() +
  geom_point(size = 2.5)


davidhodge931/ggblanket documentation built on Feb. 25, 2025, 9:17 p.m.