ggannotate: Variations of 'ggplot2::annotate()'

annotate_regpolygonR Documentation

Variations of ggplot2::annotate()

Description

annotate_regpolygon() is a shortcut of ggplot2::annotate("polygon") to draw a regular polygon.

Usage

annotate_regpolygon(
  n,
  radius = 1,
  x = 0,
  y = 0,
  start = pi/2,
  linewidth = 0,
  color = "#333333",
  fill = "#666666",
  ...
)

Arguments

n

number of sides

radius

size of polygon

x, y

center coordinate

start

angle of the starting point

linewidth, color

passed to ggplot2::annotate("path")

fill, ...

passed to ggplot2::annotate("polygon")

Examples

ggplot2::ggplot() +
  annotate_regpolygon(6L, radius = 5, linewidth = 6, color = "#333333", fill = "#ffffff") +
  annotate_regpolygon(6L, radius = 2, fill = "#C41A41") +
  ggplot2::coord_fixed()

heavywatal/rwtl documentation built on April 2, 2024, 6:08 p.m.