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

PPTX
Introduction to matplotlib
Piyush rai
 
PDF
Data visualization in Python
Marc Garcia
 
PPTX
Python Seaborn Data Visualization
Sourabh Sahu
 
PPTX
Machine learning with scikitlearn
Pratap Dangeti
 
PPTX
Jio Case Study
Karthik Raja
 
PDF
Arrays in python
moazamali28
 
PDF
Data Visualization(s) Using Python
Aniket Maithani
 
Introduction to matplotlib
Piyush rai
 
Data visualization in Python
Marc Garcia
 
Python Seaborn Data Visualization
Sourabh Sahu
 
Machine learning with scikitlearn
Pratap Dangeti
 
Jio Case Study
Karthik Raja
 
Arrays in python
moazamali28
 
Data Visualization(s) Using Python
Aniket Maithani
 

What's hot (20)

PDF
The matplotlib Library
Haim Michael
 
PDF
Introduction to Python Pandas for Data Analytics
Phoenix
 
PDF
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
PPT
Python Pandas
Sunil OS
 
PDF
Python for Data Science
Harri Hämäläinen
 
PDF
Introduction to NumPy (PyData SV 2013)
PyData
 
PDF
pandas: Powerful data analysis tools for Python
Wes McKinney
 
PPTX
Python libraries for data science
nilashri2
 
PPTX
Basic of python for data analysis
Pramod Toraskar
 
PPTX
Introduction to pandas
Piyush rai
 
PPTX
Python Scipy Numpy
Girish Khanzode
 
PPTX
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
PDF
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Edureka!
 
PDF
Data Visualization in Python
Jagriti Goswami
 
PDF
Data Analysis and Visualization using Python
Chariza Pladin
 
PDF
Introduction to XGBoost
Joonyoung Yi
 
PPTX
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Python Collections Tutorial | Edureka
Edureka!
 
PDF
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
The matplotlib Library
Haim Michael
 
Introduction to Python Pandas for Data Analytics
Phoenix
 
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
Python Pandas
Sunil OS
 
Python for Data Science
Harri Hämäläinen
 
Introduction to NumPy (PyData SV 2013)
PyData
 
pandas: Powerful data analysis tools for Python
Wes McKinney
 
Python libraries for data science
nilashri2
 
Basic of python for data analysis
Pramod Toraskar
 
Introduction to pandas
Piyush rai
 
Python Scipy Numpy
Girish Khanzode
 
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Edureka!
 
Data Visualization in Python
Jagriti Goswami
 
Data Analysis and Visualization using Python
Chariza Pladin
 
Introduction to XGBoost
Joonyoung Yi
 
Database connectivity in python
baabtra.com - No. 1 supplier of quality freshers
 
Python Collections Tutorial | Edureka
Edureka!
 
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
Ad

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

PPTX
Running Intelligent Applications inside a Database: Deep Learning with Python...
Miguel González-Fierro
 
PDF
Python Interview Questions And Answers 2019 | Edureka
Edureka!
 
ODP
Pyconmini Hiroshima 2018
ksnt
 
PDF
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
Deltares
 
PPTX
Programming for Financial Strategies
Prabhakar Verma
 
PDF
Intro to computer vision in .net
Stephen Lorello
 
PPTX
Python Pyplot Class XII
ajay_opjs
 
PDF
Easy path to machine learning
wesley chun
 
PDF
Neuroscience Lab: a tour through the eyes of a pythonista, PyData Barcelona2017
Javier Martinez Alcantara
 
DOCX
Srings
SRINIVASMUNDA
 
PDF
Getting more out of Matplotlib with GR
Josef Heinen
 
PPTX
Working with Graphs _python.pptx
MrPrathapG
 
PPTX
Data visualization by Kenneth Odoh
pyconfi
 
PPTX
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
ODP
Qt Workshop
Johan Thelin
 
PDF
AiCore Brochure 27-Mar-2023-205529.pdf
AjayRawat829497
 
PDF
datavisualizationinpythonv2-171103225436.pdf
smartashammari
 
PPTX
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
Maulik Borsaniya
 
PDF
Reproducible Workflow with Cytoscape and Jupyter Notebook
Keiichiro Ono
 
PDF
Scientific Plotting in Python
Jack Parmer
 
Running Intelligent Applications inside a Database: Deep Learning with Python...
Miguel González-Fierro
 
Python Interview Questions And Answers 2019 | Edureka
Edureka!
 
Pyconmini Hiroshima 2018
ksnt
 
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
Deltares
 
Programming for Financial Strategies
Prabhakar Verma
 
Intro to computer vision in .net
Stephen Lorello
 
Python Pyplot Class XII
ajay_opjs
 
Easy path to machine learning
wesley chun
 
Neuroscience Lab: a tour through the eyes of a pythonista, PyData Barcelona2017
Javier Martinez Alcantara
 
Getting more out of Matplotlib with GR
Josef Heinen
 
Working with Graphs _python.pptx
MrPrathapG
 
Data visualization by Kenneth Odoh
pyconfi
 
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
Qt Workshop
Johan Thelin
 
AiCore Brochure 27-Mar-2023-205529.pdf
AjayRawat829497
 
datavisualizationinpythonv2-171103225436.pdf
smartashammari
 
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
Maulik Borsaniya
 
Reproducible Workflow with Cytoscape and Jupyter Notebook
Keiichiro Ono
 
Scientific Plotting in Python
Jack Parmer
 
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!
 

Recently uploaded (20)

PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
The Future of Artificial Intelligence (AI)
Mukul
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 

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