SlideShare a Scribd company logo
7
Most read
11
Most read
14
Most read
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Python Matplotlib
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Agenda
➢ Why Data Visualization?
➢ What Is Data Visualization?
➢ What Is Matplotlib?
➢ Types Of Plots
➢ Getting Started
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Why Data Visualization?
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Why Data Visualization?
Human brain can process information easily when it is in pictorial or graphical form
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Why Data Visualization?
Data visualization allows us to quickly interpret the data and adjust different variables to see their effect
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
What Is Data Visualization?
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
What Is Data Visualization?
Data visualization is the presentation of data in a pictorial or graphical format.
Visualize
Analyse
Document
Insight
Transform
Data set
Finding
Insights In
Data
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
What Is Matplotlib?
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
What is Matplolib?
Matplotlib is a Python package used for 2D graphics
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Types Of Plots
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Types of Plots
Bar graph Histograms Scatter Plot
Pie Plot Hexagonal Bin Plot Area Plot
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Getting Started
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Getting Started
Here's some basic code to generate one of the most simple graph.
from matplotlib import pyplot as plt
#Plotting to our canvas
plt.plot([1,2,3],[4,5,1])
#Showing what we plotted
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Getting Started
Lets add title and labels to our graph
from matplotlib import pyplot as plt
x = [5,8,10]
y = [12,16,6]
plt.plot(x,y)
plt.title('Info')
plt.ylabel('Y axis')
plt.xlabel('X axis')
plt.show()
Title
Labels
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Adding Style To Our Graph
from matplotlib import pyplot as plt
from matplotlib import style
style.use('ggplot')
x = [5,8,10]
y = [12,16,6]
x2 = [6,9,11]
y2 = [6,15,7]
plt.plot(x,y,'g',label='line one', linewidth=5)
plt.plot(x2,y2,'c',label='line two',linewidth=5)
plt.title('Epic Info')
plt.ylabel('Y axis')
plt.xlabel('X axis')
plt.legend()
plt.grid(True,color='k')
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Bar Graph
import matplotlib.pyplot as plt
plt.bar([1,3,5,7,9],[5,2,7,8,2], label="Example one")
plt.bar([2,4,6,8,10],[8,6,2,5,6], label="Example two", color='g')
plt.legend()
plt.xlabel('bar number')
plt.ylabel('bar height')
plt.title('Info')
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Histogram
import matplotlib.pyplot as plt
population_ages =
[22,55,62,45,21,22,34,42,42,4,99,102,110,120,121,122,130,111,115,112,80,75,6
5,54,44,43,42,48]
bins = [0,10,20,30,40,50,60,70,80,90,100,110,120,130]
plt.hist(population_ages, bins, histtype='bar', rwidth=0.8)
plt.xlabel('x')
plt.ylabel('y')
plt.title('Histogram')
plt.legend()
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Scatter Plot
import matplotlib.pyplot as plt
x = [1,2,3,4,5,6,7,8]
y = [5,2,4,2,1,4,5,2]
plt.scatter(x,y, label='skitscat', color='k)
plt.xlabel('x')
plt.ylabel('y')
plt.title('Scatter Plot')
plt.legend()
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Stack Plot
import matplotlib.pyplot as plt
days = [1,2,3,4,5]
sleeping = [7,8,6,11,7]
eating = [2,3,4,3,2]
working = [7,8,7,2,2]
playing = [8,5,7,8,13]
plt.plot([],[],color='m', label='Sleeping', linewidth=5)
plt.plot([],[],color='c', label='Eating', linewidth=5)
plt.plot([],[],color='r', label='Working', linewidth=5)
plt.plot([],[],color='k', label='Playing', linewidth=5)
plt.stackplot(days, sleeping,eating,working,playing, colors=['m','c','r','k'])
plt.xlabel('x')
plt.ylabel('y')
plt.title('Stck Plot')
plt.legend()
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Pie Chart
import matplotlib.pyplot as plt
slices = [7,2,2,13]
activities = ['sleeping','eating','working','playing']
cols = ['c','m','r','b']
plt.pie(slices,
labels=activities,
colors=cols,
startangle=90,
shadow= True,
explode=(0,0.1,0,0),
autopct='%1.1f%%')
plt.title('Pie Plot')
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Working With Multiple Plots
import numpy as np
import matplotlib.pyplot as plt
def f(t):
return np.exp(-t) * np.cos(2*np.pi*t)
t1 = np.arange(0.0, 5.0, 0.1)
t2 = np.arange(0.0, 5.0, 0.02)
plt.subplot(211)
plt.plot(t1, f(t1), 'bo', t2, f(t2))
plt.subplot(212)
plt.plot(t2, np.cos(2*np.pi*t2))
plt.show()
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Session In A Minute
Why Data Visualization? What Is Data Visualization?
Types Of Plots Getting Started
What Is Matplotlib?
Working With Multiple Plots
www.edureka.co/pythonEDUREKA PYTHON CERTIFICATION TRAINING
Thank You …
Questions/Queries/Feedback

More Related Content

What's hot (20)

PDF
The matplotlib Library
Haim Michael
 
PPTX
Python Seaborn Data Visualization
Sourabh Sahu
 
PDF
pandas - Python Data Analysis
Andrew Henshaw
 
PDF
Python libraries
Prof. Dr. K. Adisesha
 
PPTX
Python Scipy Numpy
Girish Khanzode
 
PDF
Data Visualization in Python
Jagriti Goswami
 
PPTX
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
PPTX
Data Analysis with Python Pandas
Neeru Mittal
 
PDF
Pandas
maikroeder
 
PPTX
Python pandas Library
Md. Sohag Miah
 
ODP
Python Modules
Nitin Reddy Katkam
 
PDF
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Edureka!
 
PDF
Zero to Hero - Introduction to Python3
Chariza Pladin
 
PPTX
MatplotLib.pptx
Paras Intotech
 
PPTX
Visualization and Matplotlib using Python.pptx
SharmilaMore5
 
PDF
pandas: Powerful data analysis tools for Python
Wes McKinney
 
PDF
Introduction to Python Pandas for Data Analytics
Phoenix
 
PPTX
Introduction to pandas
Piyush rai
 
PPT
Python ppt
Rohit Verma
 
PDF
Data Visualization(s) Using Python
Aniket Maithani
 
The matplotlib Library
Haim Michael
 
Python Seaborn Data Visualization
Sourabh Sahu
 
pandas - Python Data Analysis
Andrew Henshaw
 
Python libraries
Prof. Dr. K. Adisesha
 
Python Scipy Numpy
Girish Khanzode
 
Data Visualization in Python
Jagriti Goswami
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
Data Analysis with Python Pandas
Neeru Mittal
 
Pandas
maikroeder
 
Python pandas Library
Md. Sohag Miah
 
Python Modules
Nitin Reddy Katkam
 
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Edureka!
 
Zero to Hero - Introduction to Python3
Chariza Pladin
 
MatplotLib.pptx
Paras Intotech
 
Visualization and Matplotlib using Python.pptx
SharmilaMore5
 
pandas: Powerful data analysis tools for Python
Wes McKinney
 
Introduction to Python Pandas for Data Analytics
Phoenix
 
Introduction to pandas
Piyush rai
 
Python ppt
Rohit Verma
 
Data Visualization(s) Using Python
Aniket Maithani
 

Similar to Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python Training | Edureka (20)

PDF
Chapter3_Visualizations2.pdf
MekiyaShigute1
 
PPTX
Matplotlib.pptx
AbdulrahmanMohammed166612
 
PPTX
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
hemalathab24
 
PDF
16. Data VIsualization using PyPlot.pdf
RrCreations5
 
PPTX
UNIT_4_data visualization.pptx
BhagyasriPatel2
 
PDF
Introduction to Data Visualization,Matplotlib.pdf
sumitt6_25730773
 
PPTX
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
PPTX
Python chart plotting using Matplotlib.pptx
sonali sonavane
 
PPTX
matplotlib _
swati463221
 
PPTX
Data Visualization 2020_21
Sangita Panchal
 
DOCX
Data visualization using py plot part i
TutorialAICSIP
 
PPTX
Matplotlib_Presentation jk jdjklskncncsjkk
sarfarazkhanwattoo
 
PPTX
Python Pyplot Class XII
ajay_opjs
 
PPTX
Python for Data Science
Panimalar Engineering College
 
PDF
Lecture 34 & 35 -Data Visualizationand itd.pdf
ShahidManzoor70
 
PDF
12-IP.pdf
kajalkhorwal106
 
PDF
AIS Technical Development Workshop 4: Data visualization with Python libraries
Nhi Nguyen
 
PDF
Intermediate python ch1_slides
Atul Kumar
 
PPTX
Data Science.pptx00000000000000000000000
shaikhmismail66
 
PPTX
Python_Matplotlib_13. _Slides.pptx
sukeerthankoyyada
 
Chapter3_Visualizations2.pdf
MekiyaShigute1
 
Matplotlib.pptx
AbdulrahmanMohammed166612
 
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
hemalathab24
 
16. Data VIsualization using PyPlot.pdf
RrCreations5
 
UNIT_4_data visualization.pptx
BhagyasriPatel2
 
Introduction to Data Visualization,Matplotlib.pdf
sumitt6_25730773
 
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
Python chart plotting using Matplotlib.pptx
sonali sonavane
 
matplotlib _
swati463221
 
Data Visualization 2020_21
Sangita Panchal
 
Data visualization using py plot part i
TutorialAICSIP
 
Matplotlib_Presentation jk jdjklskncncsjkk
sarfarazkhanwattoo
 
Python Pyplot Class XII
ajay_opjs
 
Python for Data Science
Panimalar Engineering College
 
Lecture 34 & 35 -Data Visualizationand itd.pdf
ShahidManzoor70
 
12-IP.pdf
kajalkhorwal106
 
AIS Technical Development Workshop 4: Data visualization with Python libraries
Nhi Nguyen
 
Intermediate python ch1_slides
Atul Kumar
 
Data Science.pptx00000000000000000000000
shaikhmismail66
 
Python_Matplotlib_13. _Slides.pptx
sukeerthankoyyada
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Digital Circuits, important subject in CS
contactparinay1
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 

Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python Training | Edureka