Re: [R] coloured letters in a text

2008-08-28 Thread Fränzi Korner
Hi does somebody know how to plot single letters in a text in different colours? example 1: I would like to add the word ABC to a figure. Thereby each letter should have a different colour. text(x,y,ABC, col=c(1,2,3)) # this does not work example 2: I would like to add the name of a

Re: [R] coloured letters in a text

2008-08-28 Thread Barry Rowlingson
2008/8/28 Fränzi Korner [EMAIL PROTECTED]: example 1: I would like to add the word ABC to a figure. Thereby each letter should have a different colour. text(x,y,ABC, col=c(1,2,3)) # this does not work kludge alert! How about: text(x,y,ABC,col=3) text(x,y,AB,col=2) text(x,y,A,col=1)

Re: [R] coloured letters in a text

2008-08-28 Thread Gabor Grothendieck
See ?strwidth, e.g. plot(1) text(1.1, 1.1, A) text(1.1 + strwidth(A), 1.1, B, col = 2) text(1.1 + strwidth(AB), 1.1, C, col = 3) On Thu, Aug 28, 2008 at 7:33 AM, Fränzi Korner [EMAIL PROTECTED] wrote: Hi does somebody know how to plot single letters in a text in different colours? example

Re: [R] coloured letters in a text

2008-08-28 Thread Prof Brian Ripley
On Thu, 28 Aug 2008, Barry Rowlingson wrote: 2008/8/28 Fränzi Korner [EMAIL PROTECTED]: example 1: I would like to add the word ABC to a figure. Thereby each letter should have a different colour. text(x,y,ABC, col=c(1,2,3)) # this does not work kludge alert! How about: