0% found this document useful (0 votes)
37 views4 pages

Python Matplotlib

Matplotlib tutorial

Uploaded by

Vinith Acharya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

Python Matplotlib

Matplotlib tutorial

Uploaded by

Vinith Acharya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Search...

Tutorials Courses Tracks Sign In

Matplotlib Pandas Seaborn Ggplot Plotly Altair Bokeh Networkx Machine Learning Math Machin Learning Data Analysis Deep Learning Deep Learning Projects NLP Computer v

Matplotlib Tutorial
Last Updated : 23 Jul, 2025

Matplotlib is an open-source visualization library for the Python programming


language, widely used for creating static, animated and interactive plots. It provides an
object-oriented API for embedding plots into applications using general-purpose GUI
toolkits like Tkinter, Qt, GTK and wxPython. It offers a variety of plotting functionalities,
including line plots, bar charts, histograms, scatter plots and 3D visualizations. Created
by John D. Hunter in 2003, Matplotlib has become a fundamental tool for data
visualization in Python, extensively used by data scientists, researchers and engineers
worldwide.

To learn Matplotlib step-by-step, refer to our page: Matplotlib Step-by-Step Guide.

Geeksforgeeks.org asks for your consent to use


your personal data to:
Personalised advertising and content, advertising and content
measurement, audience research and services development

Store and/or access information on a device 2/6

Learn more

Important FactsYour
to personal
know:data will be processed and information from your device
(cookies, unique identifiers, and other device data) may be stored by,
accessed
Matplotlib Pyplot: by andpyplot
The shared with 497 TCF vendor(s)
module and 70 ad partner(s)
is a collection , or
of functions that make
used specifically by this site or app.
Matplotlib work like MATLAB, providing a simple interface for creating plots.
Some vendors may process your personal data on the basis of legitimate
interest,Inwhich
Figure and Axes: you can object
Matplotlib, to by managing
figures your options
represent below. Look
the overall container, while
for a link at the bottom of this page or in the site menu to manage or
axes refer to withdraw
the individual
consent in plots within
privacy and cookieasettings.
figure.
Integration with Pandas: Matplotlib works seamlessly with Pandas
DataFrames, enabling efficient
Manage optionsdata visualization.Consent

What is Matplotlib in Python used for?


With Matplotlib, we can perform a wide range of visualization tasks, including:

Creating basic plots such as line, bar and scatter plots.


Customizing plots with labels, titles, legends and color schemes.
Adjusting figure size, layout and aspect ratios.
Saving plots in various formats like PNG, PDF and SVG.
Combining multiple plots into subplots for better data representation.
Creating interactive plots using the widget module.

Learn Matplotlib
Now that we know what Matplotlib is and its uses, let’s move towards the tutorial part.
Below, you will find sections ranging from basic to advanced topics that will help you
master Matplotlib.

Matplotlib Basics
In this section, we will explore the fundamentals of Matplotlib. We will start with an
introduction, learn how to install it and understand its core functionalities. Additionally,
we will cover how to use Jupyter Notebook for interactive visualizations.

Matplotlib Introduction
Installing Matplotlib
Skip to content
Using Jupyter Notebook for Visualizations

Plotting with Matplotlib


This section focuses on different types of plots and their implementations using
Matplotlib.

Basic graph in Matplotlib


Line Plots in Matplotlib
Bar Charts with Matplotlib
Scatter Plots in Matplotlib
Histograms in Matplotlib
Pie Charts with Matplotlib
3D plot in Matplotlib

Customization in Matplotlib
Matplotlib provides extensive customization options for better visualization and
aesthetics.

Markers in Matplotlib
Adding Labels in Matplotlib
Configuring Grid in Matplotlib
Creating Subplots in Matplotlib
Styling Plots with Matplotlib
Resize a Plot in Matplotlib
Adjust Plot Transparency in Matplotlib
Change Fonts in Matplotlib
Set Tick Label Font Size in Matplotlibasks for your consent to use
Geeksforgeeks.org
Change Plot Background Color in Matplotlib
your personal data to:
Move Axis Labels in Matplotlib
Personalised advertising and content, advertising and content
Hide Axis, Borders and Extra Space
measurement, in Matplotlib
audience research and services development

Store and/or access information on a device


Advanced Plotting with Matplotlib
Explore advanced visualization techniques using Matplotlib’s powerful functionalities.
Your personal data will be processed and information from your device
Creating 3D Plots
(cookies, unique identifiers, and other device data) may be stored by,
accessed byPlots
Surface and Wireframe and shared with 497 TCF vendor(s) and 70 ad partner(s), or
used specifically by this site or app.
Heatmaps and Contour Plots
Some vendors may process your personal data on the basis of legitimate
Animating Plotsinterest,
with which
Matplotlib
you can object to by managing your options below. Look
for a link at the bottom of this page or in the site menu to manage or
withdraw consent in privacy and cookie settings.

Saving and Exporting Plots


Save your visualizations in various formats for reports and presentations.

Saving Plots as PNG, JPG and SVG


Exporting Plots to PDF
Saving Multiple Figures

Toolkits in Matplotlib
Several toolkits extend Matplotlib's functionality, some of which are external downloads,
while others are included with Matplotlib but have external dependencies. Here are
some of the most notable toolkits:

Seaborn: A high-level statistical data visualization library built on top of Matplotlib,


extremely popular for creating attractive and informative statistical graphics with
minimal code.
Mplot3d: Integrated into Matplotlib itself, this toolkit is the go‑to choice for creating
3‑D plots with ease and flexibility.
GeoPandas: A library that leverages Matplotlib for geospatial plotting, simplifying the
handling of geospatial data without needing a spatial database.
Cartopy: A modern mapping library offering an object‑oriented approach to map
projections and geospatial data, largely replacing Basemap in new projects.
Tikzplotlib: A niche toolkit that converts Matplotlib figures into LaTeX-friendly
TikZ/PGFPlots code, ideal for producing high-quality, publication-ready plots.

Matplotlib with Pandas and Seaborn


Integrate Matplotlib with Pandas and Seaborn for enhanced data visualization.
Skip to content
Using Matplotlib with Pandas DataFrames
Visualizing Time Series Data
Combining Seaborn and Matplotlib
Creating Pair Plots
Correlation Heatmaps

Matplotlib Quiz
Test your knowledge of Matplotlib with this quiz. It covers essential topics such as
plotting techniques, customization and integration with other libraries.

Matplotlib Basics Quiz

Projects
Create a 3D Sine Wave with Matplotlib in Python
Visualize Bubble Sort with Python
Merge Sort Visualization Using Matplotlib
Quick Sort Visualization Using Matplotlib
3D Quick Sort Visualization with Matplotlib in Python
3D Merge Sort Visualization with Matplotlib
3D Insertion Sort Visualization with Matplotlib in Python
Create a Time Series Plot with Rolling Average in Python
Plot Different Sounds Using Python and Matplotlib
Visualizing COVID-19 Data with Matplotlib in Python
Analyzing Used Car Prices Using Python

Geeksforgeeks.org asks for your consent to use


your personal data to:
Personalised advertising and content, advertising and content
measurement, audience research and services development

Store and/or access information on a device


Your personal data will be processed and information from your device
(cookies, unique identifiers, and other device data) may be stored by,
accessed by and shared with 497 TCF vendor(s) and 70 ad partner(s), or
used specifically by this site or app.
Some vendors may process your personal data on the basis of legitimate
interest, which you can object to by managing your options below. Look
for a link at the bottom of this page or in the site menu to manage or
withdraw consent in privacy and cookie settings.

Matplotlib in Python

Comment More info

Explore
Python Fundamentals

Python Data Structures

Advanced Python

Data Science with Python

Web Development with Python

Python Practice

Company Explore Tutorials Courses Videos Preparation Corner


About Us POTD Programming Languages IBM Certification DSA Aptitude
Corporate & Communications Address: Legal Job-A-Thon DSA DSA and Placements Python Puzzles
Skip to content
A-143, 7th Floor, Sovereign Corporate Privacy Policy Community Web Technology Web Development Java GfG 160
Tower, Sector- 136, Noida, Uttar Pradesh Contact Us Blogs AI, ML & Data Science Programming Languages C++ DSA 360
(201305) Advertise with us Nation Skill Up DevOps DevOps & Cloud Web Development System Design
GFG Corporate Solution CS Core Subjects GATE Data Science
Registered Address:
Campus Training Interview Preparation Trending Technologies CS Subjects
K 061, Tower K, Gulshan Vivante
Apartment, Sector 137, Noida, Gautam Program GATE
Buddh Nagar, Uttar Pradesh, 201305 Software and Tools

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

Geeksforgeeks.org asks for your consent to use


your personal data to:
Personalised advertising and content, advertising and content
measurement, audience research and services development

Store and/or access information on a device

Your personal data will be processed and information from your device
(cookies, unique identifiers, and other device data) may be stored by,
accessed by and shared with 497 TCF vendor(s) and 70 ad partner(s), or
used specifically by this site or app.
Some vendors may process your personal data on the basis of legitimate
interest, which you can object to by managing your options below. Look
for a link at the bottom of this page or in the site menu to manage or
withdraw consent in privacy and cookie settings.

You might also like