The grob-column function where an object is converted a grob. Works within grob_row
.
grob_col(
...,
p = 1,
width = NA_real_,
aes_list = ga_list(),
border = FALSE,
border_aes_list = ga_list(),
title = "",
title_aes_list = ga_list(),
title_p = 0.15,
title_height = NA_real_,
caption = "",
caption_aes_list = ga_list(),
caption_p = 0.15,
caption_height = NA_real_,
padding_p = 0.05,
padding = NA_real_,
hjust = 0.5,
vjust = 0.5
)
An R6 class object containing all the information needed to create the grob-column.
Either the object to be converted to a grob, or a combination of grob-rows which need to be converted to sub-grobs.
The numeric proportion of the width given to the outer grob-row which should be given to the grob-column outputted by this function. Defaults to 1.
The numeric width of the grob-column in millimeters.
Overrides the p
parameter.
The list outputted by ga_list
, which controls
aesthetics object within the grob-column.
A TRUE/FALSE argument corresponding to whether or not a border around the outputted grob-column is desired. Defaults to FALSE.
The list outputted by ga_list
, which
controls aesthetics of the borders. Only two aesthetics that can be tweaked
for borders are border_color
, border_width
and border_sides
.
Ignored if border
is set to FALSE.
A character string which will be displayed as the title of the grob-column.
The list outputted by ga_list
, which
controls aesthetics of the title of the grob-column.
The numeric proportion of height within the grob-column which will be used by the title grob.
The numeric height in mm within the grob-column which will
be used by the title grob. Will override title_p
if provided.
A character string which will be displayed as the caption of the grob-column.
The list outputted by ga_list
, which
controls aesthetics of the caption of the grob-column.
The numeric proportion of height within the grob-column which will be used by the caption grob.
The numeric height in mm within the grob-column which will
be used by the caption grob. Will override caption_p
if provided.
The proportion of the minimum of the height and width which will be used for the padding around the edge of the grob-column.
Overridden by any numeric value provided in the padding
parameter.
The numeric amount of padding around the edge of the grob-column in millimeters.
Overrides the padding_p
parameter.
A numeric value which will determine the alignment of the grob horizontally within its designated area. A value of 0 means moving the grob all the way to the left, a value of 1 means moving the grob all the way to the right and a value of 0.5 means keeping the grob in the middle. Defaults to 0.5.
The grob-column is moved around within its padding, so if
there is no padding, then hjust
will be rendered useless.
A numeric value which will determine the alignment of the grob vertically within its designated area. A value of 0 means moving the grob all the way to the bottom, a value of 1 means moving the grob all the way to the top and a value of 0.5 means keeping the grob in the middle. Defaults to 0.5.
The grob-column is moved around within its padding, so if there is no padding,
then vjust
will be rendered useless.
grob_col(
"grob-column",
aes_list = ga_list(
text_color = "red",
background_color = "gray90"
)
) %>%
view_grob(100, 100)
Run the code above in your browser using DataLab