How to Annotate a plot with P-value in ggplot2

Annotate a plot with p-value from linear regression model in ggplot2: Example 2

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

How to order facet variable in grouped boxplot by mean difference between groups in ggplot2

In this tutorial, we will learn how to order facet variable in a grouped boxplot by mean difference between groups in each facet plot with ggplot2. We will use Palmer penguin dataset to make a grouped boxplot using facet_wrap() in ggplot2. Our data looks like this. First, let us make a grouped boxplot using facet_wrap().… Continue reading How to order facet variable in grouped boxplot by mean difference between groups in ggplot2

How to Move Facet strip label to the bottom

In this tutorial, we will learn how to move the strip label title text in ggplot2’s facet* functions to the bottom. By default, facet_wrap() creates a box for each strip with a label at the top of the small multiple plot. In this post, we will show how to move the strip label to the… Continue reading How to Move Facet strip label to the bottom

4 Ways to have Plots Side by side in ggplot2

In this post, we will learn how to combine two plots side-by-side using four different approaches. First, we will show how we can use facet_wrap() function in ggplot2, if we are interested in similar plots (small multiples) side by side. Next three approaches are more general, i.e. combining any two plots side by side using… Continue reading 4 Ways to have Plots Side by side in ggplot2

Exit mobile version