Heatmaps are a great way to quickly visualize the actual data coded as colors. Heatmaps of correlation matrix is useful to understand the relationship between multiple features or variable. However, since the correlation matrix is symmetric, it is more useful to make heatmap of upper or lower triangular part of correlation matrix as having both… Continue reading How To Make Lower Triangular Heatmap with Python?
How To Color Scatterplot by a variable in Matplotlib?
Scatterplots between two numerical variables are great to see the relationship between them. Adding colors to the data points based on the third categorical variable is often useful in understanding the relationship among the three variables. In this post, we will learn how to color data points in a scatterplot by a third categorical variable… Continue reading How To Color Scatterplot by a variable in Matplotlib?
How To Get the Default Color Codes of ggplot2?
ggplot2 adds colors to its plot automatically. Sometimes you might want to get the list of colors (color codes) that ggplot2 uses. In this post, we will learn how to get the color codes that ggplot2 uses by default in a plot. We will use scales package in tidyverse to get the colors for different… Continue reading How To Get the Default Color Codes of ggplot2?
How To Manually Specify Colors for Barplot in ggplot2?
One of the great things about making plots with ggplot2 is that it offers a number of ways to add colors to the plots. We can use ggplot2’s default options for adding colors to plots. However, sometimes one might want to manually specify colors to a plot. There are a few ways to manually specify… Continue reading How To Manually Specify Colors for Barplot in ggplot2?
How To Make Scatterplot with Marginal Histograms in R?
In this post, we will learn how to make a scatterplot with marginal histograms in R. We will use ggExtra, one of the ggplot2 extension packages to make scatterplot with marginal histogram. First, we will add simple marginal histograms to a scatterplot made with ggplot2. Next, we we will show how to color the histogram… Continue reading How To Make Scatterplot with Marginal Histograms in R?