richtextGrob: richtextGrob

View source: R/geom_richtext2.R

richtextGrobR Documentation

richtextGrob

Description

richtextGrob

Usage

richtextGrob(
  label,
  x = 0,
  y = 1,
  hjust = 0,
  vjust = 1,
  mar = 0.02,
  padding = unit(c(1, 1, 1, 1) * 0, "pt"),
  lineheight = 1.5,
  fontsize = 12,
  fontface = 1,
  family = "Times",
  color = "black",
  ...
)

Arguments

x, y

Unit objects specifying the location of the reference point.

hjust, vjust

Numerical values specifying the justification of the text boxes relative to x and y. These justification parameters are specified in the internal reference frame of the text boxes, so that, for example, hjust adjusts the vertical justification when the text is rotated 90 degrees to the left or right.

...

other parameters to gridtext::richtext_grob()

Examples

text <- c(
  "Some text **in bold.**",
  "Linebreaks<br>Linebreaks<br>Linebreaks",
  "*x*<sup>2</sup> + 5*x* + *C*<sub>*i*</sub>",
  "Some <span style='color:blue'>blue text **in bold.**</span><br>And 
  *italics text.*<br>And some <span style='font-size:18pt; color:black'>
  large</span> text."
)

rpkgs/gg.layers documentation built on Sept. 14, 2024, 11:07 p.m.