[R] multiple colors within same line of text
jrkrideau at yahoo.ca
Fri Aug 17 13:24:55 CEST 2007
This is pretty clumsy but it seems to work. I suspect
there are many better ways
x <- seq(0, 1, length=21)
colour <- c("red", "blue")
mytext <- c("RED", "BLUE")
mtext( mytext, at= c(2,5), side=1, col=colour)
--- Andrew Yee <andrewjyee at gmail.com> wrote:
> Hi, I'm interested in using mtext(), but with the
> option of having multiple
> colors in the same line of text.
> For example, creating a line of text where:
> Red is red and blue is blue
> How do you create a text argument that lets you do
> this within mtext()?
> MGH Cancer Center
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained,
> reproducible code.
More information about the R-help