Adding vertical line or lines at mean or median of density plot can help us understand the trend in the data. When you make multiple density plots adding vertical mean/median line for each group in the same color as the density plot is of great help. In this post, we will see an example of… Continue reading How to Add Vertical Lines By a Variable in Multiple Density Plots with ggplot2
Author: datavizpyr
How To Make Boxplots in base R?
In this post, we will learn how to make simple boxplots using base R function boxplot(). We will use mtcars dataset available readily in R to first make a simple boxplot using boxplot() function in base R. And then we will learn how to customize the boxplot with specifying x and y-axis labels. Finally, we… Continue reading How To Make Boxplots in base R?
How to Make Countplot or barplot with Seaborn Catplot?
Sometimes you might want to make countplot or barplots in Python, but the data may not in the right format. For example, you might want to make countplot/barplot of the number of things corresponding to multiple categorical variables. However, the data may in the form such that you have compute the counts per category. Seaborn’s… Continue reading How to Make Countplot or barplot with Seaborn Catplot?
How to Make Horizontal Boxplot with ggplot2 version 3.3.0?
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 barplot without using coord_flip(). Let us… Continue reading How to Make Horizontal Boxplot with ggplot2 version 3.3.0?
How To Highlight a Time Range in Time Series Plot in Python with Matplotlib?
Time Series Plots are line plots with x-axis being date time instead of regular quantitative or ordered categorical variable. Sometimes you might want to highlight a region on a time series plot. In this post, we will learn how to highlight a time interval with a rectangular colored block in Python using Matplotlib. Let us… Continue reading How To Highlight a Time Range in Time Series Plot in Python with Matplotlib?