SlideShare a Scribd company logo
Data manipulation:
Plotting and Visualization
AAA-Python Edition
Plan
●
1- matplotlib
●
2- Plotting with Pandas and seaborn
●
3- Interactive and dynamic graphics
3
1-matplotlib
[By Amina Delali]
Basic PlottingBasic Plotting
●
Importing pyplot module
from matplotlib (as plt)
ser1 The series values are the
y values, the series index
values, are the x values
You have to use this command, to
be able to see all the plots
( embed an image after each plot)
4
1-matplotlib
[By Amina Delali]
Basic PlottingBasic Plotting
●
To plot in this part just use:
axis2.plot(ser1)
To divide the
region in 4
subplots just
use:
add_subplot(
2,2,”position”)
5
1-matplotlib
[By Amina Delali]
Customizing plotsCustomizing plots
●
(From google colab help)
colors
Some line styles and
markers
6
1-matplotlib
[By Amina Delali]
Basic PlottingBasic Plotting
●
ser1
The xticklabes: 4
xticks ==> 4
labels
Mark the x axis at the
positions: 0, 2 4 and 6
and labeled A, B, C
and D
The title
7
1-matplotlib
[By Amina Delali]
AnnotationsAnnotations
●
Creating the
rectangle
Adding the
rectangle to the
plot
8
1-matplotlib
[By Amina Delali]
AnnotationsAnnotations
●
The arrow is drawn
at the left of the text
The y position of the
text (3) is under the
y position of the
annotation (5) so by
defalut the arrow is
drawn at the botom
of the plot
9
1-matplotlib
[By Amina Delali]
File handling and configurationFile handling and configuration
●
You can specify an
svg file as well
●
You can customize the default options of matplotlib plots, you can use
the rc method
Real size
10
2-Plottingwith
pandasandseaborn
[By Amina Delali]
Line plots with pandasLine plots with pandas
●ser1 df1
Plotting only these
2 columns
11
2-Plottingwith
pandasandseaborn
[By Amina Delali]
Bar plots with pandasBar plots with pandas
●
To each value correspond a bar. In df1
plot, the bars are grouped by column
For horizontal
bars
The 3 values in
one bar
12
2-Plottingwith
pandasandseaborn
[By Amina Delali]
Bar plots with seabornBar plots with seaborn
●
Importing seaborn library
An other column cat added to df1 used to separate
data in categories. Since there is no val2 duplicates,
so for each val2 there is only one bar
13
2-Plottingwith
pandasandseaborn
[By Amina Delali]
HistogramsHistograms
●
14
2-Plottingwith
pandasandseaborn
[By Amina Delali]
Points (scatter) plot with seabornPoints (scatter) plot with seaborn
●
Will plot the data points and
a linear regression model fit
The line that tries to fit
to the data
15
2-Plottingwith
pandasandseaborn
[By Amina Delali]
Categorical DataCategorical Data
●
df4
Category 1, dimension 2 (col)
Category 2, dimension 2 (col)
Category 1, dimension 1 (hue)
Category 2, dimension 1 (hue)
16
3-Interactive
anddynamicgraphics
[By Amina Delali]
BokehBokeh
●
To install bokeh library
Hexadecimal
colors code
X values
y values
17
3-Interactive
anddynamicgraphics
[By Amina Delali]
plotlyplotly
●
You have to define this function and call it in each cell containing a plot
18
3-interactive
Anddynamicgraphics
[By Amina Delali]
Basic PlottingBasic Plotting
●
The generated scatter plot
References
●
Wes McKinney. Python for data analysis: Data wrangling
with Pandas, NumPy, and IPython. O’Reilly Media, Inc, 2018.
Thank
you!
FOR ALL YOUR TIME

More Related Content

What's hot (20)

PPTX
Circular queue
Lovely Professional University
 
PPSX
Algorithm and Programming (Sorting)
Adam Mukharil Bachtiar
 
PPT
Heaps & Adaptable priority Queues
Priyanka Rana
 
PPT
Priority queues and heap sorting
heshekik
 
PPT
Intro matlab
danie_sileshi
 
PDF
Parallel Algorithms
Dr Sandeep Kumar Poonia
 
PDF
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
AminaRepo
 
PPTX
Intensity Transformation Functions of image with Matlab
Shafi Sourov
 
PPTX
4. Queues in Data Structure
Mandeep Singh
 
PDF
Queues-handouts
Fajar Baskoro
 
PPTX
Clean, Learn and Visualise data with R
Barbara Fusinska
 
PDF
LEC4-DS ALGO.pdf
MuhammadUmerIhtisham
 
PPTX
Lgm saarbrucken
Yasuo Tabei
 
ODP
Sorting Algorithm
Abu Shaik saurab
 
PPT
Data structure lecture7
Kumar
 
PPTX
Circular Queue data structure
Dhananjaysinh Jhala
 
PPTX
MATRIX HASHING WITH TWO LEVEL OF COLLISION RESOLUTION
Nvk Chaitanya
 
PDF
Variational Autoencoder
Mark Chang
 
PDF
R programmingmilano
Ismail Seyrik
 
PPT
Maps&hash tables
Priyanka Rana
 
Algorithm and Programming (Sorting)
Adam Mukharil Bachtiar
 
Heaps & Adaptable priority Queues
Priyanka Rana
 
Priority queues and heap sorting
heshekik
 
Intro matlab
danie_sileshi
 
Parallel Algorithms
Dr Sandeep Kumar Poonia
 
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
AminaRepo
 
Intensity Transformation Functions of image with Matlab
Shafi Sourov
 
4. Queues in Data Structure
Mandeep Singh
 
Queues-handouts
Fajar Baskoro
 
Clean, Learn and Visualise data with R
Barbara Fusinska
 
LEC4-DS ALGO.pdf
MuhammadUmerIhtisham
 
Lgm saarbrucken
Yasuo Tabei
 
Sorting Algorithm
Abu Shaik saurab
 
Data structure lecture7
Kumar
 
Circular Queue data structure
Dhananjaysinh Jhala
 
MATRIX HASHING WITH TWO LEVEL OF COLLISION RESOLUTION
Nvk Chaitanya
 
Variational Autoencoder
Mark Chang
 
R programmingmilano
Ismail Seyrik
 
Maps&hash tables
Priyanka Rana
 

Similar to Aaa ped-Data-8- manipulation: Plotting and Visualization (20)

PPTX
a9bf73_Introduction to Matplotlib01.pptx
Rahidkhan10
 
PPTX
Unit3-v1-Plotting and Visualization.pptx
yerrasaniayyapparedd
 
PPTX
Unit III for data science engineering.pptx
rhsingh033
 
PPTX
Seaborn for data visualization using python.pptx
sjcdsdocs
 
PPTX
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
PDF
Python matplotlib cheat_sheet
Nishant Upadhyay
 
PDF
Python seaborn cheat_sheet
Nishant Upadhyay
 
PPTX
Python Visualization API Primersubplots
VidhyaB10
 
PDF
Introduction to Data Visualization,Matplotlib.pdf
sumitt6_25730773
 
PPTX
Matplotlib.pptx for data analysis and visualization
bdike
 
PPTX
Introduction to matplotlib
Piyush rai
 
PPTX
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
zmulani8
 
PPTX
Python_for_Data_Visualization.pptx python for BE &Mtech
PoojaPatil286778
 
PPTX
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
hemalathab24
 
PDF
12-IP.pdf
kajalkhorwal106
 
PPTX
Introduction to Matplotlib Library in Python.pptx
bajajrishabh96tech
 
PPTX
MatplotLib.pptx
Paras Intotech
 
PPTX
python libray for data analytics seaborn[1].pptx
y18771929
 
PDF
S4-Matplotlib_Computational_Physics_.pdf
CARLOSANDRESVIDALBET
 
PPTX
Introduction to Pylab and Matploitlib.
yazad dumasia
 
a9bf73_Introduction to Matplotlib01.pptx
Rahidkhan10
 
Unit3-v1-Plotting and Visualization.pptx
yerrasaniayyapparedd
 
Unit III for data science engineering.pptx
rhsingh033
 
Seaborn for data visualization using python.pptx
sjcdsdocs
 
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
Python matplotlib cheat_sheet
Nishant Upadhyay
 
Python seaborn cheat_sheet
Nishant Upadhyay
 
Python Visualization API Primersubplots
VidhyaB10
 
Introduction to Data Visualization,Matplotlib.pdf
sumitt6_25730773
 
Matplotlib.pptx for data analysis and visualization
bdike
 
Introduction to matplotlib
Piyush rai
 
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
zmulani8
 
Python_for_Data_Visualization.pptx python for BE &Mtech
PoojaPatil286778
 
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
hemalathab24
 
12-IP.pdf
kajalkhorwal106
 
Introduction to Matplotlib Library in Python.pptx
bajajrishabh96tech
 
MatplotLib.pptx
Paras Intotech
 
python libray for data analytics seaborn[1].pptx
y18771929
 
S4-Matplotlib_Computational_Physics_.pdf
CARLOSANDRESVIDALBET
 
Introduction to Pylab and Matploitlib.
yazad dumasia
 
Ad

More from AminaRepo (20)

PDF
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
AminaRepo
 
PDF
Aaa ped-22-Artificial Neural Network: Introduction to ANN
AminaRepo
 
PDF
Aaa ped-21-Recommender Systems: Content-based Filtering
AminaRepo
 
PDF
Aaa ped-20-Recommender Systems: Model-based collaborative filtering
AminaRepo
 
PDF
Aaa ped-19-Recommender Systems: Neighborhood-based Filtering
AminaRepo
 
PDF
Aaa ped-18-Unsupervised Learning: Association Rule Learning
AminaRepo
 
PDF
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
AminaRepo
 
PDF
Aaa ped-16-Unsupervised Learning: clustering
AminaRepo
 
PDF
Aaa ped-15-Ensemble Learning: Random Forests
AminaRepo
 
PDF
Aaa ped-14-Ensemble Learning: About Ensemble Learning
AminaRepo
 
PDF
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
AminaRepo
 
PDF
Aaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
AminaRepo
 
PDF
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
AminaRepo
 
PDF
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
AminaRepo
 
PDF
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
AminaRepo
 
PDF
Aaa ped-5-Data manipulation: Pandas
AminaRepo
 
PDF
Aaa ped-4- Data manipulation: Numpy
AminaRepo
 
PDF
Aaa ped-3. Pythond: advanced concepts
AminaRepo
 
PDF
Aaa ped-2- Python: Basics
AminaRepo
 
PDF
Aaa ped-1- Python: Introduction to AI, Python and Colab
AminaRepo
 
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
AminaRepo
 
Aaa ped-22-Artificial Neural Network: Introduction to ANN
AminaRepo
 
Aaa ped-21-Recommender Systems: Content-based Filtering
AminaRepo
 
Aaa ped-20-Recommender Systems: Model-based collaborative filtering
AminaRepo
 
Aaa ped-19-Recommender Systems: Neighborhood-based Filtering
AminaRepo
 
Aaa ped-18-Unsupervised Learning: Association Rule Learning
AminaRepo
 
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
AminaRepo
 
Aaa ped-16-Unsupervised Learning: clustering
AminaRepo
 
Aaa ped-15-Ensemble Learning: Random Forests
AminaRepo
 
Aaa ped-14-Ensemble Learning: About Ensemble Learning
AminaRepo
 
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
AminaRepo
 
Aaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
AminaRepo
 
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
AminaRepo
 
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
AminaRepo
 
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
AminaRepo
 
Aaa ped-5-Data manipulation: Pandas
AminaRepo
 
Aaa ped-4- Data manipulation: Numpy
AminaRepo
 
Aaa ped-3. Pythond: advanced concepts
AminaRepo
 
Aaa ped-2- Python: Basics
AminaRepo
 
Aaa ped-1- Python: Introduction to AI, Python and Colab
AminaRepo
 
Ad

Recently uploaded (20)

PPTX
1699424534480_FOREST_SOCIETY_and_COLONIALISM (15).pptx
kavishtiwari2009
 
PPTX
atom : it is the building unit of the structure of any matter
abdoy2605
 
PDF
Integrating Conversational Agents and Knowledge Graphs within the Scholarly D...
Angelo Salatino
 
DOCX
Accomplishment Report on YES- O SY 2025 2026.docx
WilsonVillamater
 
PDF
EV REGENERATIVE ACCELERATION INNOVATION SUMMARY PITCH June 13, 2025.pdf
Thane Heins NOBEL PRIZE WINNING ENERGY RESEARCHER
 
PDF
Study of Appropriate Information Combination in Image-based Obfuscated Malwar...
takahashi34
 
PDF
Disk Evolution Study Through Imaging of Nearby Young Stars (DESTINYS): Eviden...
Sérgio Sacani
 
PDF
Enzyme Kinetics_Lecture 8.5.2025 Enzymology.pdf
ayeshaalibukhari125
 
PPTX
Unit-1-The-Origin-of-the-Universe-and-the-Solar-System-1.pptx
SylvesterMata2
 
PPTX
The-Emergence-of-Social-Science-Disciplines-A-Historical-Journey.pptx
RomaErginaBachiller
 
PDF
Herbal Excipients: Natural Colorants & Perfumery Agents
Seacom Skills University
 
PPTX
Instrumentation of IR and Raman Spectrophotometers.pptx
sngth2h2acc
 
PPTX
Single-Cell Multi-Omics in Neurodegeneration p1.pptx
KanakChaudhary10
 
PPTX
GEN Biology 2 LESSON plant and animal 1.pptx
ElsieColico1
 
PDF
Evidence for a sub-Jovian planet in the young TWA 7 disk
Sérgio Sacani
 
PPTX
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Jean Vanderdonckt
 
PDF
HOW TO DEAL WITH THREATS FROM THE FORCES OF NATURE FROM OUTER SPACE.pdf
Faga1939
 
PPTX
FACTORS PREDISPOSING TO MICROBIAL PATHOGENICITY.pptx
Remya M S
 
PPTX
Human-AI Interaction in Space: Insights from a Mars Analog Mission with the H...
Jean Vanderdonckt
 
PDF
POLISH JOURNAL OF SCIENCE №87 (2025)
POLISH JOURNAL OF SCIENCE
 
1699424534480_FOREST_SOCIETY_and_COLONIALISM (15).pptx
kavishtiwari2009
 
atom : it is the building unit of the structure of any matter
abdoy2605
 
Integrating Conversational Agents and Knowledge Graphs within the Scholarly D...
Angelo Salatino
 
Accomplishment Report on YES- O SY 2025 2026.docx
WilsonVillamater
 
EV REGENERATIVE ACCELERATION INNOVATION SUMMARY PITCH June 13, 2025.pdf
Thane Heins NOBEL PRIZE WINNING ENERGY RESEARCHER
 
Study of Appropriate Information Combination in Image-based Obfuscated Malwar...
takahashi34
 
Disk Evolution Study Through Imaging of Nearby Young Stars (DESTINYS): Eviden...
Sérgio Sacani
 
Enzyme Kinetics_Lecture 8.5.2025 Enzymology.pdf
ayeshaalibukhari125
 
Unit-1-The-Origin-of-the-Universe-and-the-Solar-System-1.pptx
SylvesterMata2
 
The-Emergence-of-Social-Science-Disciplines-A-Historical-Journey.pptx
RomaErginaBachiller
 
Herbal Excipients: Natural Colorants & Perfumery Agents
Seacom Skills University
 
Instrumentation of IR and Raman Spectrophotometers.pptx
sngth2h2acc
 
Single-Cell Multi-Omics in Neurodegeneration p1.pptx
KanakChaudhary10
 
GEN Biology 2 LESSON plant and animal 1.pptx
ElsieColico1
 
Evidence for a sub-Jovian planet in the young TWA 7 disk
Sérgio Sacani
 
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Jean Vanderdonckt
 
HOW TO DEAL WITH THREATS FROM THE FORCES OF NATURE FROM OUTER SPACE.pdf
Faga1939
 
FACTORS PREDISPOSING TO MICROBIAL PATHOGENICITY.pptx
Remya M S
 
Human-AI Interaction in Space: Insights from a Mars Analog Mission with the H...
Jean Vanderdonckt
 
POLISH JOURNAL OF SCIENCE №87 (2025)
POLISH JOURNAL OF SCIENCE
 

Aaa ped-Data-8- manipulation: Plotting and Visualization