Experiment 3
Experiment 3
OBJECTIVE:
RELATED THEORY
(i) Matplotlib is a Python 2D plotting library which provides both a very quick
way to visualise data from Python and publication-quality figures in many
formats. Matplotlib can be used in Python scripts, the Python and IPython shells,
the Jupyter notebook, web application servers, and four graphical user interface
Toolkits.
(ii)Matplotlib tries to make easy things easy and hard things possible. You can
generate plots, histograms, power spectra, bar charts,scatterplots, etc., with just a few
lines of code. For error charts,examples,the sample plots and thumbnail gallery.
(iii)Seaborn is an amazing visualisation library for statistical graphics plotting in
Python. It provides beautiful default styles and colour palettes to make statistical
plots more attractive. It is built on the top of matplotlib library and also closely
integrated to the data structures from pandas. Seaborn aims to make visualisation the
central part of exploring and understanding data. It provides dataset-oriented APIs, so
that we can switch between different visual representations for same variables for
better understanding of dataset.
Question 1)
Import Matplotlib library
Question 2)
Plot a simple line plot
Question 3)
Save plots at different resolutions
Question 4)
Plot graph with Title and Axis Labels
Question 5)
Change Color of Line Plot
Question 6)
Plot multiple line plots in a single graph
Question 7)
Plot Labels of Multiple Line plots in a graph
Question 8)
Change theme of plot
Question 9)
Bar Plot
Question 10)
Horizontal Bar Chart
Question 11)
How to handle huge variations of values in bar chart?
Question 12)
Handle Huge value variations (Use log scale)
Question 13)
Plot a heatmap using seaborn library
Question 14)
Add annotations to heatmap
Question 15)
Set value format from scientific to integer
Question 15)
Set title, label, label, ticks and ysticks
Question 16)
Save a heatmap
CONCLUSION
In the above program we used matplotlib and seaborn libraries to plot various visualizations.
These visualizations include plotting line plot, bar chart (both horizontal and vertical) and
heatmaps. Several customization options have been displayed and discussed in the
demonstrations above.