SlideShare una empresa de Scribd logo
1 de 15
Introduction to
MATPLOTLIB
1
INTRODUCTION TO MATPLOTLIB
● Matplotlib is a popular Python library used for creating visualizations,
charts, and plots.
● It helps in understanding data patterns, trends, and relationships
through graphical representation.
● Importing Matplotlib:
import matplotlib.pyplot as plt
● Matplotlib provides a wide range of plot types, from basic line plots
to complex 3D visualizations. This versatility makes it suitable for
various data analysis and presentation needs, catering to different
domains such as science, engineering, finance, and more.
● Matplotlib seamlessly integrates with other popular Python libraries
such as NumPy and Pandas. This integration allows you to visualize
data structures like arrays and data frames directly without extensive
data manipulation, enhancing productivity and workflow efficiency.
2
CATEGORIZATION OF PLOTS
Matplotlib can be categorized into different types based on the number of
variables included in plots. Here are the categories:
1. Univariate Plots:
● These plots involve analyzing a single variable.
● Examples: Histograms, density plots, box plots, violin plots, bar
plots (for categorical data).
2. Bivariate Plots:
● These plots visualize relationships between two variables.
● Examples: Scatter plots, line plots (connecting two variables), bar
plots (comparing two variables), hexbin plots.
3. Multivariate Plots:
● These plots explore relationships involving more than two
variables.
● Examples: 3D scatter plots, bubble plots, pair plots (showing
relationships among multiple variables), parallel coordinate plots.
3
CATEGORIZATION OF PLOTS
4. Categorical Plots:
● These plots focus on categorical data and its distribution.
● Examples: Bar plots (for categorical data), stacked bar plots,
grouped bar plots, mosaic plots, dendrogram plots.
5. Time Series Plots:
● These plots specifically deal with time-related data.
● Examples: Line plots (over time), area plots, candlestick plots,
seasonal decomposition plots.
6. Statistical Plots:
● These plots emphasize statistical relationships and summaries.
● Examples: Regression plots, distribution plots (showing
distributions and fit), QQ plots (quantile-quantile plots).
4
CATEGORIZATION OF PLOTS
7. Network Plots:
● These plots depict relationships within networks or graphs.
● Examples: Network graphs, directed graphs, node-link diagrams.
8. Interactive Plots:
● These plots allow user interaction for exploring data.
● Examples: Interactive scatter plots, interactive line plots,
interactive heat maps.
9. Composite Plots:
● These plots combine different types of plots to show complex
relationships.
● Examples: Facet grids (grid of subplots), composite heat maps
with annotations.
Matplotlib versatility makes it suitable for creating a wide range of plots,
catering to various data visualization needs.
5
LINE PLOTS IN MATPLOTLIB
● A line plot is a fundamental type of visualization in Matplotlib that
displays data points connected by straight lines.
● It's often used to show the trend or progression of data over a
continuous interval.
● For example:
Suppose you have collected temperature data over a week. You can
create a line plot to visualize how the temperature changes each day.
6
LINE PLOTS IN MATPLOTLIB
● In this example, days represent the x-axis values (days of the week), and
temperatures represent the y-axis values (temperature in degrees Celsius). The
marker, linestyle, and color arguments customize the appearance of the line plot.
● The output of the mentioned program is as follows:
7
BAR PLOTS IN MATPLOTLIB
● A bar plot is a visualization in Matplotlib that uses rectangular bars to
represent categorical data.
● It's commonly used to compare values across different categories or groups.
● For example:
Suppose you want to compare the sales of different products in a store. You
can create a bar plot to visualize the sales for each product
8
BAR PLOTS IN MATPLOTLIB
● In this example, products represent the x-axis categories (product names), and sales
represent the heights of the bars (sales amounts). The color argument specifies the color
of the bars, and xticks(rotation=45) rotates the x-axis labels for better readability.
● The output of the mentioned program is as follows:
9
HISTOGRAMS IN MATPLOTLIB
● A histogram is a graphical representation in Matplotlib that displays
the distribution of continuous data by dividing it into intervals (bins)
and showing the frequency of data points in each bin.
● For example:
Suppose you have a dataset of exam scores and want to visualize
their distribution. You can create a histogram to show how many
students scored within specific score ranges:
10
HISTOGRAMS IN MATPLOTLIB
● In this example, exam_scores is the dataset of scores. The bins parameter specifies
the number of intervals to divide the data into. The histogram displays the
frequency of scores in each bin, helping you understand the distribution of exam
performance.
● The output of the mentioned program is as follows:
11
SCATTER PLOTS IN MATPLOTLIB
● A scatter plot is a visualization in Matplotlib that displays individual
data points as dots on a 2D plane.
● It's used to showcase relationships between two continuous
variables.
● For example:
Imagine you're analyzing the relationship between the study hours
and exam scores of a group of students. A scatter plot can help you
visualize whether there's a correlation between these variables
12
SCATTER PLOTS IN MATPLOTLIB
● In this example, study_hours and exam_scores are the two continuous variables. Each
point on the scatter plot represents a student's study hours and their corresponding exam
score. The marker argument determines the shape of the data points.
● The output of the mentioned program is as follows:
13
SUBPLOTS IN MATPLOTLIB
● Subplots in Matplotlib allow you to create multiple plots within a
single figure, enabling side-by-side comparisons or visualizing related
data.
● For example:
Suppose you want to display two line plots comparing two sets of
data in separate subplots
14
SUBPLOTS IN MATPLOTLIB
● In this example, subplot(1, 2, 1) creates the first subplot, and subplot(1, 2, 2) creates the
second. The tight_layout() call improves spacing between subplots for better presentation.
● The output of the mentioned program is as follows:
15

Más contenido relacionado

Similar a Introduction to Matplotlib Library in Python.pptx

Data Visualization in Excel
Data Visualization in ExcelData Visualization in Excel
Data Visualization in ExcelFEG
 
Graphical Analysis
Graphical AnalysisGraphical Analysis
Graphical AnalysisCIToolkit
 
Week-3 – System RSupplemental material1Recap •.docx
Week-3 – System RSupplemental material1Recap •.docxWeek-3 – System RSupplemental material1Recap •.docx
Week-3 – System RSupplemental material1Recap •.docxhelzerpatrina
 
Data Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptxData Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptxHamzaAli998966
 
From data to diagrams: an introduction to basic graphs and charts
From data to diagrams: an introduction to basic graphs and chartsFrom data to diagrams: an introduction to basic graphs and charts
From data to diagrams: an introduction to basic graphs and chartsSchool of Data
 
Different types of charts
Different types of chartsDifferent types of charts
Different types of chartsZakaria Salim
 
Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.
Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.
Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.Megha Sharma
 
Design PatternsChristian Behrenshttpswww.behance.netgall.docx
Design PatternsChristian Behrenshttpswww.behance.netgall.docxDesign PatternsChristian Behrenshttpswww.behance.netgall.docx
Design PatternsChristian Behrenshttpswww.behance.netgall.docxcarolinef5
 
Simplifying Matplotlib by examples
Simplifying Matplotlib by examplesSimplifying Matplotlib by examples
Simplifying Matplotlib by examplesMohammed Ali İsmail
 
Visualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptxVisualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptxSharmilaMore5
 
Multiple Graphs: Updatable Views
Multiple Graphs: Updatable ViewsMultiple Graphs: Updatable Views
Multiple Graphs: Updatable ViewsopenCypher
 
Types of graphs and charts and their uses with examples and pics
Types of graphs and charts and their uses  with examples and picsTypes of graphs and charts and their uses  with examples and pics
Types of graphs and charts and their uses with examples and picsMakati Science High School
 
Tips and Tricks for Data Visualization in Python
Tips and Tricks for Data Visualization in PythonTips and Tricks for Data Visualization in Python
Tips and Tricks for Data Visualization in PythonJacqueline Carvalho
 
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Erdi Karaçal
 
R programming for data science
R programming for data scienceR programming for data science
R programming for data scienceSovello Hildebrand
 
Understanding on graph in bpo
Understanding on graph in bpoUnderstanding on graph in bpo
Understanding on graph in bpoAjit Kumar
 
A Subgraph Pattern Search over Graph Databases
A Subgraph Pattern Search over Graph DatabasesA Subgraph Pattern Search over Graph Databases
A Subgraph Pattern Search over Graph DatabasesIJMER
 

Similar a Introduction to Matplotlib Library in Python.pptx (20)

Data Visualization in Excel
Data Visualization in ExcelData Visualization in Excel
Data Visualization in Excel
 
Graphical Analysis
Graphical AnalysisGraphical Analysis
Graphical Analysis
 
Week-3 – System RSupplemental material1Recap •.docx
Week-3 – System RSupplemental material1Recap •.docxWeek-3 – System RSupplemental material1Recap •.docx
Week-3 – System RSupplemental material1Recap •.docx
 
Data Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptxData Visualization using different python libraries.pptx
Data Visualization using different python libraries.pptx
 
From data to diagrams: an introduction to basic graphs and charts
From data to diagrams: an introduction to basic graphs and chartsFrom data to diagrams: an introduction to basic graphs and charts
From data to diagrams: an introduction to basic graphs and charts
 
Different types of charts
Different types of chartsDifferent types of charts
Different types of charts
 
Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.
Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.
Visualization Techniques- Box plot, Line Chart, Scatter plot, Bar chart.
 
Design PatternsChristian Behrenshttpswww.behance.netgall.docx
Design PatternsChristian Behrenshttpswww.behance.netgall.docxDesign PatternsChristian Behrenshttpswww.behance.netgall.docx
Design PatternsChristian Behrenshttpswww.behance.netgall.docx
 
19CS3052R-CO1-7-S7 ECE
19CS3052R-CO1-7-S7 ECE19CS3052R-CO1-7-S7 ECE
19CS3052R-CO1-7-S7 ECE
 
Simplifying Matplotlib by examples
Simplifying Matplotlib by examplesSimplifying Matplotlib by examples
Simplifying Matplotlib by examples
 
Graphs in Biostatistics
Graphs in Biostatistics Graphs in Biostatistics
Graphs in Biostatistics
 
Visualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptxVisualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptx
 
Multiple Graphs: Updatable Views
Multiple Graphs: Updatable ViewsMultiple Graphs: Updatable Views
Multiple Graphs: Updatable Views
 
Types of graphs and charts and their uses with examples and pics
Types of graphs and charts and their uses  with examples and picsTypes of graphs and charts and their uses  with examples and pics
Types of graphs and charts and their uses with examples and pics
 
Tips and Tricks for Data Visualization in Python
Tips and Tricks for Data Visualization in PythonTips and Tricks for Data Visualization in Python
Tips and Tricks for Data Visualization in Python
 
Data visualization pyplot
Data visualization pyplotData visualization pyplot
Data visualization pyplot
 
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
 
R programming for data science
R programming for data scienceR programming for data science
R programming for data science
 
Understanding on graph in bpo
Understanding on graph in bpoUnderstanding on graph in bpo
Understanding on graph in bpo
 
A Subgraph Pattern Search over Graph Databases
A Subgraph Pattern Search over Graph DatabasesA Subgraph Pattern Search over Graph Databases
A Subgraph Pattern Search over Graph Databases
 

Último

Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 

Último (20)

Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 

Introduction to Matplotlib Library in Python.pptx

  • 2. INTRODUCTION TO MATPLOTLIB ● Matplotlib is a popular Python library used for creating visualizations, charts, and plots. ● It helps in understanding data patterns, trends, and relationships through graphical representation. ● Importing Matplotlib: import matplotlib.pyplot as plt ● Matplotlib provides a wide range of plot types, from basic line plots to complex 3D visualizations. This versatility makes it suitable for various data analysis and presentation needs, catering to different domains such as science, engineering, finance, and more. ● Matplotlib seamlessly integrates with other popular Python libraries such as NumPy and Pandas. This integration allows you to visualize data structures like arrays and data frames directly without extensive data manipulation, enhancing productivity and workflow efficiency. 2
  • 3. CATEGORIZATION OF PLOTS Matplotlib can be categorized into different types based on the number of variables included in plots. Here are the categories: 1. Univariate Plots: ● These plots involve analyzing a single variable. ● Examples: Histograms, density plots, box plots, violin plots, bar plots (for categorical data). 2. Bivariate Plots: ● These plots visualize relationships between two variables. ● Examples: Scatter plots, line plots (connecting two variables), bar plots (comparing two variables), hexbin plots. 3. Multivariate Plots: ● These plots explore relationships involving more than two variables. ● Examples: 3D scatter plots, bubble plots, pair plots (showing relationships among multiple variables), parallel coordinate plots. 3
  • 4. CATEGORIZATION OF PLOTS 4. Categorical Plots: ● These plots focus on categorical data and its distribution. ● Examples: Bar plots (for categorical data), stacked bar plots, grouped bar plots, mosaic plots, dendrogram plots. 5. Time Series Plots: ● These plots specifically deal with time-related data. ● Examples: Line plots (over time), area plots, candlestick plots, seasonal decomposition plots. 6. Statistical Plots: ● These plots emphasize statistical relationships and summaries. ● Examples: Regression plots, distribution plots (showing distributions and fit), QQ plots (quantile-quantile plots). 4
  • 5. CATEGORIZATION OF PLOTS 7. Network Plots: ● These plots depict relationships within networks or graphs. ● Examples: Network graphs, directed graphs, node-link diagrams. 8. Interactive Plots: ● These plots allow user interaction for exploring data. ● Examples: Interactive scatter plots, interactive line plots, interactive heat maps. 9. Composite Plots: ● These plots combine different types of plots to show complex relationships. ● Examples: Facet grids (grid of subplots), composite heat maps with annotations. Matplotlib versatility makes it suitable for creating a wide range of plots, catering to various data visualization needs. 5
  • 6. LINE PLOTS IN MATPLOTLIB ● A line plot is a fundamental type of visualization in Matplotlib that displays data points connected by straight lines. ● It's often used to show the trend or progression of data over a continuous interval. ● For example: Suppose you have collected temperature data over a week. You can create a line plot to visualize how the temperature changes each day. 6
  • 7. LINE PLOTS IN MATPLOTLIB ● In this example, days represent the x-axis values (days of the week), and temperatures represent the y-axis values (temperature in degrees Celsius). The marker, linestyle, and color arguments customize the appearance of the line plot. ● The output of the mentioned program is as follows: 7
  • 8. BAR PLOTS IN MATPLOTLIB ● A bar plot is a visualization in Matplotlib that uses rectangular bars to represent categorical data. ● It's commonly used to compare values across different categories or groups. ● For example: Suppose you want to compare the sales of different products in a store. You can create a bar plot to visualize the sales for each product 8
  • 9. BAR PLOTS IN MATPLOTLIB ● In this example, products represent the x-axis categories (product names), and sales represent the heights of the bars (sales amounts). The color argument specifies the color of the bars, and xticks(rotation=45) rotates the x-axis labels for better readability. ● The output of the mentioned program is as follows: 9
  • 10. HISTOGRAMS IN MATPLOTLIB ● A histogram is a graphical representation in Matplotlib that displays the distribution of continuous data by dividing it into intervals (bins) and showing the frequency of data points in each bin. ● For example: Suppose you have a dataset of exam scores and want to visualize their distribution. You can create a histogram to show how many students scored within specific score ranges: 10
  • 11. HISTOGRAMS IN MATPLOTLIB ● In this example, exam_scores is the dataset of scores. The bins parameter specifies the number of intervals to divide the data into. The histogram displays the frequency of scores in each bin, helping you understand the distribution of exam performance. ● The output of the mentioned program is as follows: 11
  • 12. SCATTER PLOTS IN MATPLOTLIB ● A scatter plot is a visualization in Matplotlib that displays individual data points as dots on a 2D plane. ● It's used to showcase relationships between two continuous variables. ● For example: Imagine you're analyzing the relationship between the study hours and exam scores of a group of students. A scatter plot can help you visualize whether there's a correlation between these variables 12
  • 13. SCATTER PLOTS IN MATPLOTLIB ● In this example, study_hours and exam_scores are the two continuous variables. Each point on the scatter plot represents a student's study hours and their corresponding exam score. The marker argument determines the shape of the data points. ● The output of the mentioned program is as follows: 13
  • 14. SUBPLOTS IN MATPLOTLIB ● Subplots in Matplotlib allow you to create multiple plots within a single figure, enabling side-by-side comparisons or visualizing related data. ● For example: Suppose you want to display two line plots comparing two sets of data in separate subplots 14
  • 15. SUBPLOTS IN MATPLOTLIB ● In this example, subplot(1, 2, 1) creates the first subplot, and subplot(1, 2, 2) creates the second. The tight_layout() call improves spacing between subplots for better presentation. ● The output of the mentioned program is as follows: 15