View source: R/boxGrobs_boxPropGrob.R
boxPropGrob | R Documentation |
Creates a grob box with text inside it and a color split in the horizontal axes that allow indicating different proportions. The box can also have a title that spanse the two color areas and that has its own background.
boxPropGrob(
label,
label_left,
label_right,
prop,
y = unit(0.5, "npc"),
x = unit(0.5, "npc"),
width,
height,
just = "center",
bjust = "center",
txt_gp = getOption("boxPropGrobTxt", default = gpar(color = "black")),
txt_left_gp = getOption("boxPropGrobLeftTxt", default = gpar(col = "black")),
txt_right_gp = getOption("boxPropGrobRightTxt", default = gpar(col = "black")),
box_left_gp = getOption("boxPropGrobLeft", default = gpar(fill = "#E6E8EF")),
box_right_gp = getOption("boxPropGrobRight", default = gpar(fill = "#FFFDF6")),
box_highlight_gp = getOption("boxPropGrobHighlight", default = gpar(fill = "#ffffff55",
col = NA)),
name = NULL
)
label |
The label to print - should be a number, text or expression. |
label_left |
The label for the left area |
label_right |
The label for the right area |
prop |
The proportion to split along |
y |
The y position to put the box at. Can be either in |
x |
The x position to put the box at. Can be either in |
width |
The box automatically adapts the size but you can force by specifying the width |
height |
The box automatically adapts the size but you can force by specifying the height |
just |
The justification for the text: left, center or right. |
bjust |
The justification for the box: left, center, right, top or bottom.
See the |
txt_gp |
The |
txt_left_gp |
The |
txt_right_gp |
The |
box_left_gp |
The |
box_right_gp |
The |
box_highlight_gp |
The |
name |
a character identifier for the |
A box grob
Other flowchart components:
align
,
boxGrob()
,
connectGrob()
,
coords()
,
distance()
,
moveBox()
,
spread
library(grid)
grid.newpage()
boxPropGrob("Main label", "Left text", "Right text", prop = .3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.