drawtext {EBImage} | R Documentation |
Draws text on images.
drawtext(img, xy, labels, font, col) drawfont(family=switch(.Platform$OS.type, windows="Arial", "helvetica"), style="n", size=14, weight=200, antialias=TRUE)
img |
An |
xy |
Matrix (or a list of matrices if |
labels |
A character vector (or a list of vectors if |
font |
A font object, returned by |
col |
A character vector of font colors. |
family |
A character value indicating the font family to use. Valid
examples on Linux/UNIX systems include |
style |
A character value specifying the font style to use.
Supported styles are: |
size |
Font size in points. |
weight |
A numeric value indicating the font weight (bold font). Supported values range between 100 and 900. |
antialias |
A logical value indicating whether the font should be anti-aliased. |
An Image
object or an array, containing the transformed version
of img
.
Oleg Sklyar, osklyar@ebi.ac.uk, 2007
lena = readImage(system.file("images", "lena-color.png", package="EBImage")) font = drawfont(weight=600, size=28) lena = drawtext(lena, xy=c(250, 450), labels="Lena", font=font, col="white") if (interactive()) display(lena)