SlideShare a Scribd company logo
The matplotlib Library
Haim Michael
October 14th
, 2020
All logos, trade marks and brand names used in this presentation belong
to the respective owners.
lifemichael
© 2008 Haim Michael 20150729
What is Matplotlib?
 Matplotlib is a library that allows us to create static,
animated, and interactive visualizations in Python.
© 2008 Haim Michael 20150729
Installing Matplotlib
 The simplest way to install matplotlib would be to install it
using the pip utility.
pip install matplotlib
© 2008 Haim Michael 20150729
The plot Function
 There are various ways to use the matplotlib library for
drawing diagrams. The simplest would be using the plot
function, that was defined inside the matplotlib.pyplot
module, passing over the x and the y coordinates.
© 2008 Haim Michael 20150729
The show Function
 Once completed, calling show will draw the diagram on the
screen.
import matplotlib.pyplot as plt
import numpy as np
plt.plot([1,2,3,4], [4,3,2,1], label='linear')
plt.legend()
plt.show()
© 2008 Haim Michael 20150729
The show Function
© 2008 Haim Michael 20150729
The Figure Class
 When instantiating matplotlib.figure.Figure class
we get an object that represents a window (or a page) on
which everything will be plotted.
© 2008 Haim Michael 20150729
The add_subplot Method
 We can invoke add_sublot on a Figure object in order to
add axes for plotting a diagram.
© 2008 Haim Michael 20150729
The add_subplot Method
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot()
ax.scatter([1,2,3,4,5],[4,3,7,8,20])
plt.show()
© 2008 Haim Michael 20150729
The subplots Function
 We can invoke the sublots function that was defined in the
matplotlib.pyplot module and get a tuple that holds a
reference for a Figure object and a reference for an Axes
object.
© 2008 Haim Michael 20150729
The subplots Function
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2, 20)
fig, ax = plt.subplots()
ax.plot(x, x, label='x=x')
ax.plot(x, x**2, label='x=x**2')
ax.plot(x, x**3, label='x=x**3')
ax.set_xlabel('x label')
ax.set_ylabel('y label')
ax.set_title("Simple Plot")
ax.legend()
plt.show()
© 2008 Haim Michael 20150729
The Interactive Mode
 We can turn on the interactive mode by calling the ion()
function.
 Doing so when using a Python console we will be able to
continue the execution of more statements in the Python
Console and while doing so, get to see the immediate
outcome.
© 2008 Haim Michael 20150729
The Interactive Mode
© 2008 Haim Michael 20150729
The plot() Function
 The plot() method that was defined inside the
matplotlib.pyplot module can be invoked in various
ways.
 The plot() method that was defined inside the
matplotlib.pyplot module can be invoked in various
ways.
© 2008 Haim Michael 20150729
The plot() Function
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0, 4, 0.1)
plt.plot(t, t, 'g--', t, t**2, 'bs', t, t**3, 'r^')
plt.show()
© 2008 Haim Michael 20150729
Q & A
 Thanks!
haim.michael@lifemichael.com
054-6655837
http://blog.lifemichael.com

More Related Content

What's hot (20)

Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
Piyush rai
 
Machine learning with scikitlearn
Machine learning with scikitlearnMachine learning with scikitlearn
Machine learning with scikitlearn
Pratap Dangeti
 
Introduction to NumPy
Introduction to NumPyIntroduction to NumPy
Introduction to NumPy
Huy Nguyen
 
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYAPYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
Maulik Borsaniya
 
Python Seaborn Data Visualization
Python Seaborn Data Visualization Python Seaborn Data Visualization
Python Seaborn Data Visualization
Sourabh Sahu
 
Python programming : Files
Python programming : FilesPython programming : Files
Python programming : Files
Emertxe Information Technologies Pvt Ltd
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining
Sulman Ahmed
 
Python - gui programming (tkinter)
Python - gui programming (tkinter)Python - gui programming (tkinter)
Python - gui programming (tkinter)
Learnbay Datascience
 
Python PPT
Python PPTPython PPT
Python PPT
Edureka!
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
Piyush rai
 
Python Collections
Python CollectionsPython Collections
Python Collections
sachingarg0
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
Machine Learning and its Applications
Machine Learning and its ApplicationsMachine Learning and its Applications
Machine Learning and its Applications
Bhuvan Chopra
 
Data Visualization in Python
Data Visualization in PythonData Visualization in Python
Data Visualization in Python
Jagriti Goswami
 
Packages In Python Tutorial
Packages In Python TutorialPackages In Python Tutorial
Packages In Python Tutorial
Simplilearn
 
NUMPY-2.pptx
NUMPY-2.pptxNUMPY-2.pptx
NUMPY-2.pptx
MahendraVusa
 
Introduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter NotebooksIntroduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter Notebooks
Eueung Mulyana
 
Seaborn.pptx
Seaborn.pptxSeaborn.pptx
Seaborn.pptx
TheMusicFever
 
Topic Modeling
Topic ModelingTopic Modeling
Topic Modeling
Karol Grzegorczyk
 
Python dictionary
Python   dictionaryPython   dictionary
Python dictionary
Mohammed Sikander
 
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
Piyush rai
 
Machine learning with scikitlearn
Machine learning with scikitlearnMachine learning with scikitlearn
Machine learning with scikitlearn
Pratap Dangeti
 
Introduction to NumPy
Introduction to NumPyIntroduction to NumPy
Introduction to NumPy
Huy Nguyen
 
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYAPYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
Maulik Borsaniya
 
Python Seaborn Data Visualization
Python Seaborn Data Visualization Python Seaborn Data Visualization
Python Seaborn Data Visualization
Sourabh Sahu
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining
Sulman Ahmed
 
Python - gui programming (tkinter)
Python - gui programming (tkinter)Python - gui programming (tkinter)
Python - gui programming (tkinter)
Learnbay Datascience
 
Python PPT
Python PPTPython PPT
Python PPT
Edureka!
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
Piyush rai
 
Python Collections
Python CollectionsPython Collections
Python Collections
sachingarg0
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
Machine Learning and its Applications
Machine Learning and its ApplicationsMachine Learning and its Applications
Machine Learning and its Applications
Bhuvan Chopra
 
Data Visualization in Python
Data Visualization in PythonData Visualization in Python
Data Visualization in Python
Jagriti Goswami
 
Packages In Python Tutorial
Packages In Python TutorialPackages In Python Tutorial
Packages In Python Tutorial
Simplilearn
 
Introduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter NotebooksIntroduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter Notebooks
Eueung Mulyana
 

Similar to The matplotlib Library (20)

Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib.
yazad dumasia
 
UNit-III. part 2.pdf
UNit-III. part 2.pdfUNit-III. part 2.pdf
UNit-III. part 2.pdf
MastiCreation
 
Matplotlib yayyyyyyyyyyyyyin Python.pptx
Matplotlib yayyyyyyyyyyyyyin Python.pptxMatplotlib yayyyyyyyyyyyyyin Python.pptx
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvfmatplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
zmulani8
 
Python Visualization API Primersubplots
Python Visualization  API PrimersubplotsPython Visualization  API Primersubplots
Python Visualization API Primersubplots
VidhyaB10
 
Unit3-v1-Plotting and Visualization.pptx
Unit3-v1-Plotting and Visualization.pptxUnit3-v1-Plotting and Visualization.pptx
Unit3-v1-Plotting and Visualization.pptx
yerrasaniayyapparedd
 
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUESUNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
hemalathab24
 
MatplotLib.pptx
MatplotLib.pptxMatplotLib.pptx
MatplotLib.pptx
Paras Intotech
 
Unit III for data science engineering.pptx
Unit III for data science engineering.pptxUnit III for data science engineering.pptx
Unit III for data science engineering.pptx
rhsingh033
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
 
Matplotlib.pptx for data analysis and visualization
Matplotlib.pptx for data analysis and visualizationMatplotlib.pptx for data analysis and visualization
Matplotlib.pptx for data analysis and visualization
bdike
 
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Wen-Wei Liao
 
Python for Machine Learning(MatPlotLib).pptx
Python for Machine Learning(MatPlotLib).pptxPython for Machine Learning(MatPlotLib).pptx
Python for Machine Learning(MatPlotLib).pptx
Dr. Amanpreet Kaur
 
DDU Workshop Day-2 presentation (1).pptx
DDU Workshop Day-2 presentation (1).pptxDDU Workshop Day-2 presentation (1).pptx
DDU Workshop Day-2 presentation (1).pptx
ritu23mts5729
 
Matplotlib 簡介與使用
Matplotlib 簡介與使用Matplotlib 簡介與使用
Matplotlib 簡介與使用
Vic Yang
 
Python Pyplot Class XII
Python Pyplot Class XIIPython Pyplot Class XII
Python Pyplot Class XII
ajay_opjs
 
Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...
Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...
Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...
Ashwin Hariharan
 
Introduction to Machine Learning by MARK
Introduction to Machine Learning by MARKIntroduction to Machine Learning by MARK
Introduction to Machine Learning by MARK
MRKUsafzai0607
 
Numerical_Analysis_Python_Presentation.pptx
Numerical_Analysis_Python_Presentation.pptxNumerical_Analysis_Python_Presentation.pptx
Numerical_Analysis_Python_Presentation.pptx
siniha2538
 
The num py_library_20200818
The num py_library_20200818The num py_library_20200818
The num py_library_20200818
Haim Michael
 
Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib.
yazad dumasia
 
UNit-III. part 2.pdf
UNit-III. part 2.pdfUNit-III. part 2.pdf
UNit-III. part 2.pdf
MastiCreation
 
Matplotlib yayyyyyyyyyyyyyin Python.pptx
Matplotlib yayyyyyyyyyyyyyin Python.pptxMatplotlib yayyyyyyyyyyyyyin Python.pptx
Matplotlib yayyyyyyyyyyyyyin Python.pptx
AamnaRaza1
 
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvfmatplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
zmulani8
 
Python Visualization API Primersubplots
Python Visualization  API PrimersubplotsPython Visualization  API Primersubplots
Python Visualization API Primersubplots
VidhyaB10
 
Unit3-v1-Plotting and Visualization.pptx
Unit3-v1-Plotting and Visualization.pptxUnit3-v1-Plotting and Visualization.pptx
Unit3-v1-Plotting and Visualization.pptx
yerrasaniayyapparedd
 
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUESUNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
UNIT-5-II IT-DATA VISUALIZATION TECHNIQUES
hemalathab24
 
Unit III for data science engineering.pptx
Unit III for data science engineering.pptxUnit III for data science engineering.pptx
Unit III for data science engineering.pptx
rhsingh033
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
 
Matplotlib.pptx for data analysis and visualization
Matplotlib.pptx for data analysis and visualizationMatplotlib.pptx for data analysis and visualization
Matplotlib.pptx for data analysis and visualization
bdike
 
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Wen-Wei Liao
 
Python for Machine Learning(MatPlotLib).pptx
Python for Machine Learning(MatPlotLib).pptxPython for Machine Learning(MatPlotLib).pptx
Python for Machine Learning(MatPlotLib).pptx
Dr. Amanpreet Kaur
 
DDU Workshop Day-2 presentation (1).pptx
DDU Workshop Day-2 presentation (1).pptxDDU Workshop Day-2 presentation (1).pptx
DDU Workshop Day-2 presentation (1).pptx
ritu23mts5729
 
Matplotlib 簡介與使用
Matplotlib 簡介與使用Matplotlib 簡介與使用
Matplotlib 簡介與使用
Vic Yang
 
Python Pyplot Class XII
Python Pyplot Class XIIPython Pyplot Class XII
Python Pyplot Class XII
ajay_opjs
 
Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...
Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...
Fashion E-Commerce: Using Computer Vision to Find Clothing that Fits Like a G...
Ashwin Hariharan
 
Introduction to Machine Learning by MARK
Introduction to Machine Learning by MARKIntroduction to Machine Learning by MARK
Introduction to Machine Learning by MARK
MRKUsafzai0607
 
Numerical_Analysis_Python_Presentation.pptx
Numerical_Analysis_Python_Presentation.pptxNumerical_Analysis_Python_Presentation.pptx
Numerical_Analysis_Python_Presentation.pptx
siniha2538
 
The num py_library_20200818
The num py_library_20200818The num py_library_20200818
The num py_library_20200818
Haim Michael
 
Ad

More from Haim Michael (20)

The Visitor Classic Design Pattern [Free Meetup]
The Visitor Classic Design Pattern [Free Meetup]The Visitor Classic Design Pattern [Free Meetup]
The Visitor Classic Design Pattern [Free Meetup]
Haim Michael
 
Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]
Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]
Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]
Haim Michael
 
Introduction to Pattern Matching in Java [Free Meetup]
Introduction to Pattern Matching in Java [Free Meetup]Introduction to Pattern Matching in Java [Free Meetup]
Introduction to Pattern Matching in Java [Free Meetup]
Haim Michael
 
Mastering The Collections in JavaScript [Free Meetup]
Mastering The Collections in JavaScript [Free Meetup]Mastering The Collections in JavaScript [Free Meetup]
Mastering The Collections in JavaScript [Free Meetup]
Haim Michael
 
Beyond Java - Evolving to Scala and Kotlin
Beyond Java - Evolving to Scala and KotlinBeyond Java - Evolving to Scala and Kotlin
Beyond Java - Evolving to Scala and Kotlin
Haim Michael
 
JavaScript Promises Simplified [Free Meetup]
JavaScript Promises Simplified [Free Meetup]JavaScript Promises Simplified [Free Meetup]
JavaScript Promises Simplified [Free Meetup]
Haim Michael
 
Scala Jump Start [Free Online Meetup in English]
Scala Jump Start [Free Online Meetup in English]Scala Jump Start [Free Online Meetup in English]
Scala Jump Start [Free Online Meetup in English]
Haim Michael
 
The MVVM Architecture in Java [Free Meetup]
The MVVM Architecture in Java [Free Meetup]The MVVM Architecture in Java [Free Meetup]
The MVVM Architecture in Java [Free Meetup]
Haim Michael
 
Kotlin Jump Start Online Free Meetup (June 4th, 2024)
Kotlin Jump Start Online Free Meetup (June 4th, 2024)Kotlin Jump Start Online Free Meetup (June 4th, 2024)
Kotlin Jump Start Online Free Meetup (June 4th, 2024)
Haim Michael
 
Anti Patterns
Anti PatternsAnti Patterns
Anti Patterns
Haim Michael
 
Virtual Threads in Java
Virtual Threads in JavaVirtual Threads in Java
Virtual Threads in Java
Haim Michael
 
MongoDB Design Patterns
MongoDB Design PatternsMongoDB Design Patterns
MongoDB Design Patterns
Haim Michael
 
Introduction to SQL Injections
Introduction to SQL InjectionsIntroduction to SQL Injections
Introduction to SQL Injections
Haim Michael
 
Record Classes in Java
Record Classes in JavaRecord Classes in Java
Record Classes in Java
Haim Michael
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
Haim Michael
 
Structural Pattern Matching in Python
Structural Pattern Matching in PythonStructural Pattern Matching in Python
Structural Pattern Matching in Python
Haim Michael
 
Unit Testing in Python
Unit Testing in PythonUnit Testing in Python
Unit Testing in Python
Haim Michael
 
OOP Best Practices in JavaScript
OOP Best Practices in JavaScriptOOP Best Practices in JavaScript
OOP Best Practices in JavaScript
Haim Michael
 
Java Jump Start
Java Jump StartJava Jump Start
Java Jump Start
Haim Michael
 
JavaScript Jump Start 20220214
JavaScript Jump Start 20220214JavaScript Jump Start 20220214
JavaScript Jump Start 20220214
Haim Michael
 
The Visitor Classic Design Pattern [Free Meetup]
The Visitor Classic Design Pattern [Free Meetup]The Visitor Classic Design Pattern [Free Meetup]
The Visitor Classic Design Pattern [Free Meetup]
Haim Michael
 
Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]
Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]
Typing in Python: Bringing Clarity, Safety and Speed to Your Code [Free Meetup]
Haim Michael
 
Introduction to Pattern Matching in Java [Free Meetup]
Introduction to Pattern Matching in Java [Free Meetup]Introduction to Pattern Matching in Java [Free Meetup]
Introduction to Pattern Matching in Java [Free Meetup]
Haim Michael
 
Mastering The Collections in JavaScript [Free Meetup]
Mastering The Collections in JavaScript [Free Meetup]Mastering The Collections in JavaScript [Free Meetup]
Mastering The Collections in JavaScript [Free Meetup]
Haim Michael
 
Beyond Java - Evolving to Scala and Kotlin
Beyond Java - Evolving to Scala and KotlinBeyond Java - Evolving to Scala and Kotlin
Beyond Java - Evolving to Scala and Kotlin
Haim Michael
 
JavaScript Promises Simplified [Free Meetup]
JavaScript Promises Simplified [Free Meetup]JavaScript Promises Simplified [Free Meetup]
JavaScript Promises Simplified [Free Meetup]
Haim Michael
 
Scala Jump Start [Free Online Meetup in English]
Scala Jump Start [Free Online Meetup in English]Scala Jump Start [Free Online Meetup in English]
Scala Jump Start [Free Online Meetup in English]
Haim Michael
 
The MVVM Architecture in Java [Free Meetup]
The MVVM Architecture in Java [Free Meetup]The MVVM Architecture in Java [Free Meetup]
The MVVM Architecture in Java [Free Meetup]
Haim Michael
 
Kotlin Jump Start Online Free Meetup (June 4th, 2024)
Kotlin Jump Start Online Free Meetup (June 4th, 2024)Kotlin Jump Start Online Free Meetup (June 4th, 2024)
Kotlin Jump Start Online Free Meetup (June 4th, 2024)
Haim Michael
 
Virtual Threads in Java
Virtual Threads in JavaVirtual Threads in Java
Virtual Threads in Java
Haim Michael
 
MongoDB Design Patterns
MongoDB Design PatternsMongoDB Design Patterns
MongoDB Design Patterns
Haim Michael
 
Introduction to SQL Injections
Introduction to SQL InjectionsIntroduction to SQL Injections
Introduction to SQL Injections
Haim Michael
 
Record Classes in Java
Record Classes in JavaRecord Classes in Java
Record Classes in Java
Haim Michael
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
Haim Michael
 
Structural Pattern Matching in Python
Structural Pattern Matching in PythonStructural Pattern Matching in Python
Structural Pattern Matching in Python
Haim Michael
 
Unit Testing in Python
Unit Testing in PythonUnit Testing in Python
Unit Testing in Python
Haim Michael
 
OOP Best Practices in JavaScript
OOP Best Practices in JavaScriptOOP Best Practices in JavaScript
OOP Best Practices in JavaScript
Haim Michael
 
JavaScript Jump Start 20220214
JavaScript Jump Start 20220214JavaScript Jump Start 20220214
JavaScript Jump Start 20220214
Haim Michael
 
Ad

Recently uploaded (20)

The case for on-premises AI
The case for on-premises AIThe case for on-premises AI
The case for on-premises AI
Principled Technologies
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Soulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate reviewSoulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate review
Soulmaite
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Create Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent BuilderCreate Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent Builder
DianaGray10
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
IntroSlides-May-BuildWithAi-EarthEngine.pdf
IntroSlides-May-BuildWithAi-EarthEngine.pdfIntroSlides-May-BuildWithAi-EarthEngine.pdf
IntroSlides-May-BuildWithAi-EarthEngine.pdf
Luiz Carneiro
 
Securiport - A Border Security Company
Securiport  -  A Border Security CompanySecuriport  -  A Border Security Company
Securiport - A Border Security Company
Securiport
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Soulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate reviewSoulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate review
Soulmaite
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Create Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent BuilderCreate Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent Builder
DianaGray10
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
IntroSlides-May-BuildWithAi-EarthEngine.pdf
IntroSlides-May-BuildWithAi-EarthEngine.pdfIntroSlides-May-BuildWithAi-EarthEngine.pdf
IntroSlides-May-BuildWithAi-EarthEngine.pdf
Luiz Carneiro
 
Securiport - A Border Security Company
Securiport  -  A Border Security CompanySecuriport  -  A Border Security Company
Securiport - A Border Security Company
Securiport
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 

The matplotlib Library

  • 1. The matplotlib Library Haim Michael October 14th , 2020 All logos, trade marks and brand names used in this presentation belong to the respective owners. lifemichael
  • 2. © 2008 Haim Michael 20150729 What is Matplotlib?  Matplotlib is a library that allows us to create static, animated, and interactive visualizations in Python.
  • 3. © 2008 Haim Michael 20150729 Installing Matplotlib  The simplest way to install matplotlib would be to install it using the pip utility. pip install matplotlib
  • 4. © 2008 Haim Michael 20150729 The plot Function  There are various ways to use the matplotlib library for drawing diagrams. The simplest would be using the plot function, that was defined inside the matplotlib.pyplot module, passing over the x and the y coordinates.
  • 5. © 2008 Haim Michael 20150729 The show Function  Once completed, calling show will draw the diagram on the screen. import matplotlib.pyplot as plt import numpy as np plt.plot([1,2,3,4], [4,3,2,1], label='linear') plt.legend() plt.show()
  • 6. © 2008 Haim Michael 20150729 The show Function
  • 7. © 2008 Haim Michael 20150729 The Figure Class  When instantiating matplotlib.figure.Figure class we get an object that represents a window (or a page) on which everything will be plotted.
  • 8. © 2008 Haim Michael 20150729 The add_subplot Method  We can invoke add_sublot on a Figure object in order to add axes for plotting a diagram.
  • 9. © 2008 Haim Michael 20150729 The add_subplot Method import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot() ax.scatter([1,2,3,4,5],[4,3,7,8,20]) plt.show()
  • 10. © 2008 Haim Michael 20150729 The subplots Function  We can invoke the sublots function that was defined in the matplotlib.pyplot module and get a tuple that holds a reference for a Figure object and a reference for an Axes object.
  • 11. © 2008 Haim Michael 20150729 The subplots Function import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 2, 20) fig, ax = plt.subplots() ax.plot(x, x, label='x=x') ax.plot(x, x**2, label='x=x**2') ax.plot(x, x**3, label='x=x**3') ax.set_xlabel('x label') ax.set_ylabel('y label') ax.set_title("Simple Plot") ax.legend() plt.show()
  • 12. © 2008 Haim Michael 20150729 The Interactive Mode  We can turn on the interactive mode by calling the ion() function.  Doing so when using a Python console we will be able to continue the execution of more statements in the Python Console and while doing so, get to see the immediate outcome.
  • 13. © 2008 Haim Michael 20150729 The Interactive Mode
  • 14. © 2008 Haim Michael 20150729 The plot() Function  The plot() method that was defined inside the matplotlib.pyplot module can be invoked in various ways.  The plot() method that was defined inside the matplotlib.pyplot module can be invoked in various ways.
  • 15. © 2008 Haim Michael 20150729 The plot() Function import matplotlib.pyplot as plt import numpy as np t = np.arange(0, 4, 0.1) plt.plot(t, t, 'g--', t, t**2, 'bs', t, t**3, 'r^') plt.show()
  • 16. © 2008 Haim Michael 20150729 Q & A  Thanks! [email protected] 054-6655837 http://blog.lifemichael.com