[R] Double Colors in Main

Lorenzo Isella lorenzo.isella at gmail.com
Tue Mar 2 14:18:25 CET 2010


Dear All,
Consider the following trivial code snippet

rm(list=ls())
name_vec <- c("color1", "color2")

pdf("test_color.pdf")
plot(seq(5), seq(5), main=paste(name_vec[1]," and ",name_vec[2], sep=""))

dev.off()


What I would like to achieve is rather simple to explain, but it is 
giving me a headache: how can I have two colors in main? Let us say that 
I would like 'color1' to be blue and 'color2' to be black.
Many thanks

Lorenzo



More information about the R-help mailing list