1

I have a simple line plot, drawn in R using the ggplot package, with two lines, one red and one blue. The chart title explains both lines and I do not want to include a legend. I would like part of the chart title to be black, part red and part blue. I know how to change the colour of the entire chart title, but how does one change the colour of selected words within the title?

ggplot(data.frame(x=1:5,y=1:5,z=10:14)) + 
geom_line(aes(x=x,y=y),colour="red") + 
geom_line(aes(x=x,y=z),colour="blue") + 
theme(plot.title=element_text(colour="black")) + 
labs(title="One line is red and the other is blue")
Phil Smith
  • 430
  • 2
  • 12
  • 2
    Is this [question](https://stackoverflow.com/questions/49735290/ggplot2-color-individual-words-in-title) helpful? (note other linked answers provided in this post as well) – Ben Jan 30 '20 at 19:43

0 Answers0