Bar plots are the graphs that use bars to compare different categories of data. Bars can be shown vertically or horizontally, based on which axis is used for a categorical variable. Let's assume that we have data on the number of ice creams sold every month in an ice cream parlor over a period of one year. We can visualize this using a bar plot.
Bar plot
Getting ready
We will use the Python calendar package to map numeric months (1 to 12) to the corresponding descriptive months (January to December).
Before we plot the graph, we need to import the necessary packages:
import matplotlib.pyplot as plt
import numpy as np
import calendar