ctext | R Documentation |
Add color to individual words in text functions. ctext
,
cmtext
, and ctitle
are analogous to text
,
mtext
, and title
, respectively. Note that
title
accepts some graphical parameters specific to the label type,
e.g., col.main
, but this is not implemented in ctitle
–colors
will be recycled if more than one label type is given. Similarly, further
graphical parameters such as cex
or line
will be passed to
all label types; see examples.
ctext(text, cols, space = TRUE, ...)
cmtext(text, cols, space = TRUE, ...)
ctitle(
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
cols,
space = TRUE,
...
)
text |
vector of text |
cols |
vector of colors; should be the same lenght as |
space |
logical; if |
... |
additional parameters passed to |
main, sub, xlab, ylab |
vector(s) of text for specific labels |
plot(1, ann = FALSE)
ctext(x = 1, y = 1, text = c('hello','little','point'), cols = 1:3, pos = 1)
cmtext(c('a','side','label'), 1:2, space = FALSE, side = 4, cex = 3)
cmtext(c('a','a','a'), 4:6, space = FALSE, side = 4, cex = 3, line = -2)
## note that line, cex, font, etc will be recycled
ctitle(main = c('the','main','label'), xlab = c('x','label'),
ylab = c('y','label'), sub = c('sub', 'label'), col = 3:5)
ctitle(xlab = c('another','label'), ylab = c('another','label'),
font = 3, col = 1:2, line = 2, cex = 1.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.