R6 class for adding labels to a ggbrain_panel
R6 class for adding labels to a ggbrain_panel
a ggbrain_label R6 class containing fields related to ggbrain plot labels
addl_argsa named list of additional argument to be passed to geom_text/geom_label at render
dataa data.frame containing labels to be printed on the panel. Must contain dim1, dim2, and label as columns. The dim1 and dim2 columns control where the labels will appear on the panel
imageA character string specifying the image to which these labels pertain
label_columnA character string indicating which data.frame column should be used for drawing labels
min_pxA positive integer indicating the minimum number of pixels present on slice that will generate a label
new()create a new ggbrain_label object
ggbrain_label$new(
data = NULL,
geom = "text",
image = NULL,
label_column = NULL,
min_px = NULL,
...
)dataa data.frame containing labels to be printed on the panel. Must contain dim1, dim2, and label as columns. The dim1 and dim2 columns control where the labels will appear on the panel
geomThe geom type to be plotted. Must be "text" or "label", corresponding to geom_text and geom_label, respectively.
imageA string specifying the image to which these labels pertain
label_columnthe column in data that should be drawn as labels on the plot
min_pxthe minimum number of pixels
...All other arguments that will be passed directly to geom_text or geom_label such as hjust, size, and color
add_to_gg()add this text layer to an existing ggplot object
ggbrain_label$add_to_gg(base_gg)base_ggthe ggplot object to which we add the layer
clone()The objects of this class are cloneable with this method.
ggbrain_label$clone(deep = FALSE)deepWhether to make a deep clone.