Build a grob with a legend inside.
gtable_legend(
d,
labels,
widths,
heights,
fg_fun,
fg_params,
bg_fun = NULL,
bg_params = NULL,
title_x = NULL,
title_y = NULL,
title_label = "Title",
title_gp = gpar(fontsize = 10),
labels_pad = -1,
labels_gp = gpar(fontsize = 6),
padding = 0.3,
size_unit = "mm",
name = "legend",
vp = NULL,
orientation = c("horizontal", "vertical"),
...
)data.frame or matrix
tick labels displayed at legend tick marks
optional unit.list specifying the grob widths
optional unit.list specifying the grob heights
grob-drawing function
named list of params passed to fg_fun
grob-drawing function
named list of params passed to bg_fun
unit specifying the x position of the title
unit specifying the x position of the title
character vector
graphical parameters of the title
padding between the text labels
graphical parameters of the text labels
numeric vector specifying the padding between adjacent cells.
character vector defining the unit used for sizes. See grid::unit for all possible
specifications
name of the grob
optional viewport
choose 'horizontal' or 'vertical'
additional parameters passed to add_table_params.
A gtable object.