Making a boxplot or barplot horizontally can be useful in a variety of scenarios. In ggplot2, till now the only way to make a plot horizontal is to use flip the axis using coord_flip(). With ggplot2 version 3.3.0, we can easily flip axis and make horizontal boxplot or horizontal … [Read more...] about How to Make Horizontal Boxplot with ggplot2 version 3.3.0?
R
How to Color Boxplots with R Colorbrewer Color Palettes?
Adding right colors to the plots greatly help convey the main message of the plot. Adding colors manually can be a bit challenging. Color palettes available from RColorBrewer package make it easy add right set of colors to plots made with ggplo2. In this tutorial, we will see … [Read more...] about How to Color Boxplots with R Colorbrewer Color Palettes?
How To Make US State and County Level Maps in R?
In this post we will learn how to make simple maps using ggplot2 in R. We will first see an example of making a state level US map and then we will see an example of county level statemap. Then finally we will see how to overlay data of interest on to the map. To be more specific … [Read more...] about How To Make US State and County Level Maps in R?
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 … [Read more...] about How To Avoid Overlapping Labels in ggplot2?
Multiple Line Plots or Time Series Plots with ggplot2 in R
Line plots or time series plots are helpful to understand the trend over time. In this post we will learn how to make multiple line plots (or time-series plots in the sample plot) in R using ggplot2. Let us load tidyverse the suite of R packages including ggplot2 to make the … [Read more...] about Multiple Line Plots or Time Series Plots with ggplot2 in R