When you have data for a variable corresponding to multiple groups, visualizing the data for each group can be useful. One of the techniques to use is to visualize data from multiple groups in a single plot. However, a better way visualize data from multiple groups is to use “facet” or small multiples. ggplot2 makes… Continue reading How To Make Facet Plot using facet_wrap() in ggplot2?
Category: ggplot2
How To Adjust Title Position in ggplot2 ?
One of the annoying things while making a plot is fine tuning it the way you want. Sometimes ones of such pain points is placing the title on the plot. Till recently, ggplot2 placed title or subtitle such that it aligns with the plotting area. In this post we will learn how to use ggplot2… Continue reading How To Adjust Title Position in ggplot2 ?
How To Make Boxplots with Text as Points in R using ggplot2?
Boxplots with overlayed data points is a great way visualize multiple distributions. One of the biggest benefits of adding data points over the boxplot is that we can actually see the underlying data instead of just the summary stat level data visualization. Sometimes using text labels instead of data points can be helpful as it… Continue reading How To Make Boxplots with Text as Points in R using ggplot2?
How To Avoid Overlapping Labels in ggplot2?
A common problem in making plots, say a barplot or boxplot with a number of groups is that, names of the groups on x-axis label often overlap with each other. Till now, one of the solutions to avoid overlapping text x-axis is to swap x and y axis with coord_flip() and make a horizontal barplot… Continue reading How To Avoid Overlapping Labels in ggplot2?
How To Make Barplots with Error bars in ggplot2?
In this post, we will learn how to make a barplot with error bar using ggplot2 in R. Barplot alone is useful to display counts for multiple categories. However, often there may be uncertainty around the count values and we could represent as error bar on the barplot. Let us load tidyverse packages. We will… Continue reading How To Make Barplots with Error bars in ggplot2?