Histograms are of great use to visualize a uni-variate distribution. As ggplot2 defines, histograms “Visualise the distribution of a single continuous variable by dividing the x axis into bins and counting the number of observations in each bin.” ggplot2’s geom_histogram() function displays the counts as bars and it also makes it easy to customize histograms… Continue reading 5 tips to make better histograms with ggplot2 in R
Tag: ggplot2
Coloring Barplots with ggplot2 in R
In this tutorial, we will see examples of making barplots and coloring the barplots in a few simple ways. We will see how to color barplots manually by specifying a color of interest and how to color a barplot by another variable in the dataset. Let us load tidyverse suite of packages and set the… Continue reading Coloring Barplots with ggplot2 in R
How to Make Horizontal Stacked Barplots with ggplot2 in R?
Stacked barcharts are a variant of barplots, when you have data from multiple groups. In this tutorial, we will see two examples of making stacked barplots using ggplt2 in R. First we will see how to make stacked barplot of two groups with one on top of the other. In the second example we will… Continue reading How to Make Horizontal Stacked Barplots with ggplot2 in R?
Heatmap from Matrix using ggplot2 in R
Heatmaps are data visualization tool that displays a matrix of data as a matrix of colors. For example, matrix elements with low values will have lighter colors and the elelments with high values will have a darker color. In earlier post we saw examples of making heatmap using ggplot2 in R. However, we assumed that… Continue reading Heatmap from Matrix using ggplot2 in R
How To Make Simple Heatmaps with ggplot2 in R?
Heatmaps visualizes multi-dimensional data as a matrix filled with colors based on their numerical value. For example the portion of matrix with low values will have one color and the portion with high values will have another color. This can help us identify the pattern in the data easily. In this post we will examples… Continue reading How To Make Simple Heatmaps with ggplot2 in R?