Skip to content
Prev 167770 / 398502 Next

title: words in different colors?

2009/1/21 Michael Friendly <friendly at yorku.ca>:
Solution from http://tolstoy.newcastle.edu.au/R/e2/help/07/09/24599.html
adapted for title:

  plot(1:10)
  title(expression("hair Color" * phantom(" and Eye color")),col.main="red")
  title(expression(phantom("hair Color and ") * "Eye color"),col.main="blue")
  title(expression(phantom("hair Color ") * "and" * phantom("Eye
color"),col.main="black"))

 The trick is to overlay three titles, one for each colour, with the
stuff not in that colour wrapped in a phantom() call to produce the
correct spacing in invisible ink.

  There's probably other ways...

Barry