When you make data visualization one might want to highlight a specific region of the plot by adding some annotation. In this post, we will learn how to add rectangle on top of a plot made with matplotlib in Python. We will first add a simple rectangle with specific color and … [Read more...] about How To Draw a Rectangle on a Plot in Matplotlib?
Matplotlib
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 … [Read more...] about How To Color Scatterplot by a variable in Matplotlib?
How To Adjust Positions of Axis Labels in Matplotlib?
In this post, we will learn how to adjust positions of x-axis and y-axis labels in Matplotlib in Python. By default, plots with matplotlib places the axis labels in the middle. With matplotlib version 3.3.0, the matplotlib functions set_xlabel and set_ylabel have a new parameter … [Read more...] about How To Adjust Positions of Axis Labels in Matplotlib?
How to Show Mean on Boxplot using Seaborn in Python?
Boxplots show five summary statistics, including median, derived from data to show distribution of numerical data corresponding categorical variables. Sometimes, you might want to highlight the mean values in addition to the five statistics of boxplot. In this post we will … [Read more...] about How to Show Mean on Boxplot using Seaborn in Python?
How to Annotate Bars in Grouped Barplot in Python?
In this post we will learn examples of adding text, annotating bars in grouped barplot using matplotlib. We will first see how to make grouped barplots using Seaborn's barplot() function and then use Matplotlib to add annotations to the grouped bars. The way to add annotation … [Read more...] about How to Annotate Bars in Grouped Barplot in Python?