| nr_text_mono | R Documentation |
The only font currently available is 'spleen' - a monospace bitmap font from: https://github.com/fcambus/spleen
nr_text_mono(
nr,
x,
y,
str,
color = "black",
fontsize = 8L,
hjust = 0.5,
vjust = 0.5,
use_alpha = TRUE
)
nr |
native raster image |
x, y |
coordinates of lower-left corner of text |
str |
character string |
color |
Color as a character string. Either a standard R color
(e.g. 'blue', 'white')
or a hex color of the form |
fontsize |
height of font in pizels. Only valid values are 8, 12 and 16. Default: 8. |
hjust, vjust |
Justification of text relative to its |
use_alpha |
Use alpha channel when drawing? Logical. Default: TRUE |
The 'spleen' font is licensed under BSD and the license is included in this package as "LICENSE-spleen.txt". To view LICENSE:
cat(readLines(system.file('LICENSE-spleen.txt', package = 'nara')),
sep = "\n")
Invisibly return the supplied native raster image which was been modified in-place
w <- 150
h <- 30
nr <- nr_new(w, h, 'grey80')
nr_text_mono(nr, x = w/2, y = h/2, str = "Hello RStats!", fontsize = 16)
plot(nr)
nr <- nr_new(w, h, 'grey80')
nr_text_mono(nr, x = 0, y = 0, str = "Hello RStats!", hjust = 0, vjust = 1, fontsize = 16)
plot(nr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.