Day2Part2. DataVisualization
Day2Part2. DataVisualization
data visualization?
For clear data
transmission
Scripting Layer
(pyplot)
Architecture
Matplotlib Artist Layer
Backend Layer
Matplotlib library
Introduction to Matplotlib
Matplotlib is a cross-platform, data visualization and graphical plotting library for Python and its
numerical extension NumPy.
Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area
in a figure, plots some lines in a plotting area, decorates the plot with labels, etc.
Matplotlib library
1. Installing Matplotlib
Matplotlib and its dependencies can be downloaded as a binary (pre-compiled) package from
the Python Package Index (PyPI), and installed with the following command:
2. Import matplotlib.pyplot
Numpy is a package for scientific computing. Numpy is a required dependency for matplotlib,
which uses numpy functions for numerical data and multi-dimensional arrays
Pandas is a library used by matplotlib mainly for data manipulation and analysis. Pandas provides
an in-memory 2D data table object called a Dataframe. Unlike numpy, pandas is not a required
dependency of matplotlib.
Pandas and numpy are often used together
Let's Go!
Functions Description
Functions Description
Functions Description
A line graph reveals trends or progress over time, and you can use it to show many different
categories of data. You should use it when you chart a continuous data set.
Quantitative Data
A scatter plot or scattergram chart will show the relationship between two different variables or
reveal distribution trends.
Quantitative Data
Histogram represents the frequency distribution of variables in a data set.
Link to source
Seaborn
Seaborn library
Seaborn
Seaborn is a data visualization library built on top of
matplotlib and closely integrated with pandas data
structures in Python.
Matplotlib is a Python library used to plot various graphs with the help of additional libraries like
Numpy and Pandas. It is an effective Python tool for data visualization and is mainly used to plot
2D graphs of arrays. Moreover, it also uses Pyplot to offer a free and open-source MATLAB-like
interface. It can work with different operating systems and their graphical front ends.
Seaborn is also a Python library that utilizes Matplotlib, Pandas, and Numpy to plot graphs. It is a
superset of the Matplotlib library and is constructed on top of it. It helps in the visualization of
univariate and bivariate data. Moreover, you can use it to create static Time-Series data graphs.
Data Visualization with GhatGPT
ChatGPT could:
Example:
Let's do some practice!
Review
1.Matplotlib is one of the most successful and commonly used
libraries, that provide various tools for data visualization in Python.
2. Matplotlib and Seaborn can deal with visualization of Pandas
data frames