THADOMAL SHAHANI ENGINEERING COLLEGE
DEPARTMENT OF INFORMATION TECHNOLOGY
12. Numpy and Matplotlib
Aim:
To study and implement various types of plots using the Matplotlib library in Python.
Theory:
Matplotlib is a widely used data visualization library in Python. It provides various types of plots
to represent data effectively. Some of the commonly used plots are:
1. Line graphs
A line graph is used to show consecutive data or trends across time. It uses a continuous line to
join individual data points.
2. Bar Charts
Rectangular bars that are proportionate in length to the values they represent are used in bar
graphs to display categorical data.
3. Histograms
A dataset's frequency distribution is shown using a histogram. It counts the number of
occurrences in each bin after dividing the data into bins.
4. Pie charts
A circular statistical graph that has been sliced into slices to show numerical proportions is called
a pie chart.
Code and Output:
Conclusion:
By implementing various types of plots using Matplotlib, we learned how to visualize data
effectively. These visualizations help in understanding trends, distributions, and relationships in
data.