library("tinyplot")
tinyplot(mpg ~ hp | factor(cyl),
data = mtcars,
type = type_text(
labels = row.names(mtcars),
font = 2,
adj = 0))
Text annotations plot type
Description
Type function for adding text annotations to a plot. This function allows you to draw text at specified (x,y) coordinates.
Usage
type_text(
labels,
adj = NULL,
pos = NULL,
offset = 0.5,
vfont = NULL,
font = NULL
)
Arguments
labels
|
Character vector of length 1 or of the same length as the number of x,y coordinates. |
adj
|
one or two values in \([0, 1]\) which specify the x (and optionally y) adjustment (‘justification’) of the labels, with 0 for left/bottom, 1 for right/top, and 0.5 for centered. On most devices values outside \([0, 1]\) will also work. See below. |
pos
|
a position specifier for the text. If specified this overrides any adj value given. Values of 1 , 2 , 3 and 4 , respectively indicate positions below, to the left of, above and to the right of the specified (x,y) coordinates.
|
offset
|
when pos is specified, this value controls the distance (‘offset’) of the text label from the specified coordinate in fractions of a character width.
|
vfont
|
NULL for the current font family, or a character vector of length 2 for Hershey vector fonts. The first element of the vector selects a typeface and the second element selects a style. Ignored if labels is an expression.
|
font
|
Font to be used, following graphics::par()
|