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
Pandas csv
PDF
Data Visualization(s) Using Python
PPTX
Visualization and Matplotlib using Python.pptx
PPTX
Python Scipy Numpy
PDF
Python NumPy Tutorial | NumPy Array | Edureka
PDF
Data Analysis and Visualization using Python
PDF
Introduction to Python Pandas for Data Analytics
Pandas csv
Data Visualization(s) Using Python
Visualization and Matplotlib using Python.pptx
Python Scipy Numpy
Python NumPy Tutorial | NumPy Array | Edureka
Data Analysis and Visualization using Python
Introduction to Python Pandas for Data Analytics

What's hot (20)

PPTX
Python - Numpy/Pandas/Matplot Machine Learning Libraries
PDF
Data Visualization in Python
PDF
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
PPTX
Introduction to matplotlib
PDF
Introduction to NumPy (PyData SV 2013)
PPTX
Data Analysis in Python-NumPy
PDF
Numpy tutorial
PPTX
NumPy.pptx
PDF
The matplotlib Library
PPTX
Modules in Python Programming
PPTX
Object oriented programming in python
PPTX
Python Seaborn Data Visualization
PPTX
Data Science With Python | Python For Data Science | Python Data Science Cour...
PPTX
Scikit Learn intro
PDF
Introduction to Deep Learning, Keras, and TensorFlow
PPTX
Introduction to numpy
PDF
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
PDF
Naive Bayes
PDF
Python programming : Files
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Data Visualization in Python
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Introduction to matplotlib
Introduction to NumPy (PyData SV 2013)
Data Analysis in Python-NumPy
Numpy tutorial
NumPy.pptx
The matplotlib Library
Modules in Python Programming
Object oriented programming in python
Python Seaborn Data Visualization
Data Science With Python | Python For Data Science | Python Data Science Cour...
Scikit Learn intro
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to numpy
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Naive Bayes
Python programming : Files
Ad

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

PPTX
Data Visualization using Matplotlib to understand Graphs
PDF
Chapter3_Visualizations2.pdf
PPTX
Matplotlib.pptx
PPTX
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
PDF
16. Data VIsualization using PyPlot.pdf
PPTX
UNIT_4_data visualization.pptx
PPTX
Foundation of Data Science Unit -5 Presentation2
PDF
Introduction to Data Visualization,Matplotlib.pdf
PPTX
Matplotlib yayyyyyyyyyyyyyin Python.pptx
PPTX
Python chart plotting using Matplotlib.pptx
PPTX
matplotlib _
PPTX
Data Visualization 2020_21
DOCX
Data visualization using py plot part i
PPTX
Matplotlib_Presentation jk jdjklskncncsjkk
PPTX
Python Pyplot Class XII
PPTX
Python for Data Science
PDF
Lecture 34 & 35 -Data Visualizationand itd.pdf
PDF
12-IP.pdf
PDF
AIS Technical Development Workshop 4: Data visualization with Python libraries
PDF
Intermediate python ch1_slides
Data Visualization using Matplotlib to understand Graphs
Chapter3_Visualizations2.pdf
Matplotlib.pptx
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
16. Data VIsualization using PyPlot.pdf
UNIT_4_data visualization.pptx
Foundation of Data Science Unit -5 Presentation2
Introduction to Data Visualization,Matplotlib.pdf
Matplotlib yayyyyyyyyyyyyyin Python.pptx
Python chart plotting using Matplotlib.pptx
matplotlib _
Data Visualization 2020_21
Data visualization using py plot part i
Matplotlib_Presentation jk jdjklskncncsjkk
Python Pyplot Class XII
Python for Data Science
Lecture 34 & 35 -Data Visualizationand itd.pdf
12-IP.pdf
AIS Technical Development Workshop 4: Data visualization with Python libraries
Intermediate python ch1_slides
Ad

More from Edureka! (20)

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

Recently uploaded (20)

PDF
Introduction to c language from lecture slides
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
The AI Revolution in Customer Service - 2025
PPT
Overviiew on Intellectual property right
PDF
Fitaura: AI & Machine Learning Powered Fitness Tracker
PPT
Storage Area Network Best Practices from HP
PDF
Examining Bias in AI Generated News Content.pdf
PDF
Decision Optimization - From Theory to Practice
PPTX
Information-Technology-in-Human-Society (2).pptx
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
Ericsson 5G Feature,KPIs Analysis_ Overview, Dependencies & Recommendations (...
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
Advancements in abstractive text summarization: a deep learning approach
PPTX
Digital Convergence: How GIS, BIM, and CAD Revolutionize Asset Management
PDF
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
PDF
Streamline Vulnerability Management From Minimal Images to SBOMs
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
Introduction to c language from lecture slides
Report in SIP_Distance_Learning_Technology_Impact.pptx
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
The AI Revolution in Customer Service - 2025
Overviiew on Intellectual property right
Fitaura: AI & Machine Learning Powered Fitness Tracker
Storage Area Network Best Practices from HP
Examining Bias in AI Generated News Content.pdf
Decision Optimization - From Theory to Practice
Information-Technology-in-Human-Society (2).pptx
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Intravenous drug administration application for pediatric patients via augmen...
Ericsson 5G Feature,KPIs Analysis_ Overview, Dependencies & Recommendations (...
Presentation - Principles of Instructional Design.pptx
Advancements in abstractive text summarization: a deep learning approach
Digital Convergence: How GIS, BIM, and CAD Revolutionize Asset Management
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
Streamline Vulnerability Management From Minimal Images to SBOMs
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf

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