Data Visualization using Matplotlib

Data Visualization is an integral part of any data science project. By using visual elements like charts, graphs, and maps, data visualization tools provide an accessible way to see and understand trends, outliers, and patterns in data. For this purpose, Matplotlib provides a much easier way to visualize data using python. Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.

In this article some plots are discussed with codes snippet in python. For this purpose, famous Iris dataset was used. The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant.

Importing Libraries

Some essential libraries which are used are imported like: Pandas, Numpy and Matplotlib.


As we can see, this dataset contains 150 rows and 6 columns. There are 3 different species in the target column and four different input features.


It is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data.

In these plots petal length and sepal length are displayed. We can clearly see the scatter plot of “petal length” can be grouped into three clusters.


A histogram is a graphical display of data using bars of different heights. In a histogram, each bar groups numbers into ranges.


A boxplot is a standardized way of displaying the distribution of data based on a five number summary (minimum, first quartile (Q1), median, third quartile (Q3), and maximum).

So, Data Visualization helps decision makers understand how the data could be interpreted and hidden insights can be pulled out using different graphs and plots.


Leave a Comment

Your email address will not be published. Required fields are marked *