In this tutorial, we will learn how to add statistical significance to a plot made with ggplot2. Let us we have scatterplot to help understand the relation between two numerical variables and we have done linear regression analysis to find the statisitical significance of the association. Here we will show with example how to annotate… Continue reading How to Annotate a plot with P-value in ggplot2
Category: ggtext
How to Add matching colors to keywords in title text
In this tutorial, we will learn how to color select words in title text with matching colors as in the plot made with ggplot. For example, if we had made a bar plot with two colors for two groups with ggplot2, we will learn how to color the group names in the title text with… Continue reading How to Add matching colors to keywords in title text
How to add color to axis tick labels: Hint – element_markdown() in ggtext
In this tutorial, we will learn about a nice ggplot2 trick/tip that enables colored text on axis tick labels. Thanks to new theme element element_markdown() in ggtext, R package developed by Claus Wilke, we can add colors to axis text labels. To get started, let us load the packages needed. Here we use ggtext version… Continue reading How to add color to axis tick labels: Hint – element_markdown() in ggtext