- labels
Character vector of group names (in order)
- colors
Character vector of colors matching the groups
- comparisons
Data frame with columns: group1, group2, label
- x
Numeric. X position of legend (0-1 scale or with unit)
- y
Numeric. Y position of legend (0-1 scale or with unit)
- width
Numeric. Width of legend box (default NULL = auto)
- height
Numeric. Height of legend box (default NULL = auto)
- unit
Character. Unit for width and height: "npc" (0-1 scale), "in", "cm", "mm" (default "npc")
- position
Character. Preset position: "topleft", "topright", "bottomleft", "bottomright", or NULL for manual x/y
- title
Character. Legend title (optional)
- text_size
Numeric. Font size for labels (default 10)
- text_family
Character. Font family (default "sans")
- text_face
Character. Font face (default "plain")
- title_size
Numeric. Title font size (default 11)
- title_face
Character. Title font face (default "bold")
- sig_size
Numeric. Significance symbol size (default 11)
- sig_face
Character. Significance symbol face (default "plain")
- output_width
Numeric. Output figure width in inches (for accurate bracket positioning)
- output_height
Numeric. Output figure height in inches (for accurate bracket positioning)
- bracket_margin
Numeric. Custom horizontal spacing between legend text and brackets (default NULL = auto-adaptive)
- legend_x
Numeric. Custom X position for legend box (0-1 scale, overrides adaptive positioning)
- legend_y
Numeric. Custom Y position for legend box (0-1 scale, overrides adaptive positioning)