Use Color in Titles to Highlight Findings
Use color in your title to highlight your main finding. You’ll need to:
- Add HTML in the
labs()function to add the title
- Change the
plot.titleargument in the
theme()function so that it interprets the HTML correctly
Hopefully I’ve convinced you that you don’t need to know much HTML in order to use the
ggtext package. If you do want to learn a bit more, the HTML tutorials on W3schools.com are a great place to start. Here’s the page on the
span tag if you just want to check that out.
If you want to see the the list of named colors in R, it’s here. All named colors in R should also work in HTML. So, for example, if you have a line that is blue, adding
<span style='color: blue'>Title Text</span> will make your title that same shade of blue.