R/bb_annotate_npc.R

Defines functions bb_annotate_npc

Documented in bb_annotate_npc

#' Annotate a Plot using NPC Coordinates
#' 
#' @param label the text label to apply to the plot
#' @param x NPC X coordinate
#' @param y NPC Y coordinate
#' @export
#' @import ggplot2 grid
bb_annotate_npc <- function(label, x, y, ...)
{
  annotation_custom(textGrob(
    x = unit(x, "npc"), 
    y = unit(y, "npc"), 
    label = label, ...))
}
blaserlab/blaseRtools documentation built on April 14, 2025, 6:04 p.m.