create_annotation_legend_grob: Create a self-contained vbracket legend grob for...

View source: R/annotation_grob.R

create_annotation_legend_grobR Documentation

Create a self-contained vbracket legend grob for annotation_custom

Description

This creates a grob that can be used with annotation_custom() in ggplot2. Unlike draw_legend_with_brackets(), this creates a single grob that handles its own viewport setup internally.

Usage

create_annotation_legend_grob(
  labels,
  colors,
  comparisons = NULL,
  x = 0.1,
  y = 0.9,
  width = 0.25,
  height = NULL,
  title = NULL,
  text_size = 10,
  text_family = "sans",
  text_face = "plain",
  title_size = 11,
  title_face = "bold",
  sig_size = 11,
  sig_face = "plain",
  output_width = 8,
  output_height = 6,
  bracket_margin = NULL
)

vbracket documentation built on Jan. 7, 2026, 9:06 a.m.