generate_labels: Generate labels position

View source: R/plots.R

generate_labelsR Documentation

Generate labels position

Description

Generate labels position

Usage

generate_labels(
  labels = NULL,
  input = c(0, 0),
  nrows = NULL,
  ncols = NULL,
  x_offset = 0.3,
  y_offset = 0.15,
  just = 1
)

Arguments

labels

labels

input

c(0,0)

nrows

default: NULL

ncols

default: NULL

x_offset

0.3

y_offset

0.15

just

0~5

Value

matrix

Examples

library(ggplot2)
labels <- vapply(1:8, \(i)paste0(sample(LETTERS, 4), collapse = ""), character(1))
df <- data.frame(label = labels, generate_labels(labels))
ggplot(data = df) +
  geom_label(aes(x = X1, y = X2, label = label))

pcutils documentation built on June 26, 2024, 1:06 a.m.