Matplotlib TRB CSI › Python Programming › Matplotlib

Matplotlib

Matplotlib என்பது Python-ல் graphs, charts, plots, and data visualizations உருவாக்க பயன்படும் major visualization library. Official Matplotlib documentation இதை static, animated, interactive visualizations உருவாக்கும் comprehensive Python …

Premium — locked Intermediate 38 min 291 cards 33 programs 23 MCQs v4
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock
Definition

Matplotlib என்பது Python-ல் graphs, charts, plots, and data visualizations உருவாக்க பயன்படும் major visualiza……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

x = [1, 2, 3] y = [10, 20, 30] plt.plot……

Premium This card is part of the premium lesson. Unlock
Simple Explanation

Suppose student marks: Arun = 80 Bala = 90 Kumar = 70 Numbers மட்டும் பார்த்தால்: 80 90 70 difference உடனடியா……

Premium This card is part of the premium lesson. Unlock
Comparison

↓ Pattern / Trend கண்டுபிடித்த……

Premium This card is part of the premium lesson. Unlock
Flow

Raw Data ↓ Python List / NumPy Array / Pandas Data ↓ Import Matplotlib ↓ Choose Plot Type ↓ Create Plot ↓ ……

Premium This card is part of the premium lesson. Unlock
Syntax
Matplotlib pyplot import
Explanation

Here: matplotlib → Library pyplot → Plotting interface/module plt → Common alias Basic Plot Syntax ……

Premium This card is part of the premium lesson. Unlock
Program
Program 1
Explanation

x = [1, 2, 3, 4] y = [10, 20,……

Premium This card is part of the premium lesson. Unlock

(1,10) (2,20) (3,30) (4,40)…

Premium This card is part of the premium lesson. Unlock
Concept

Y 40 | * 30 | * 20 | * 10 | *……

Premium This card is part of the premium lesson. Unlock

Why Matplotlib?

Matplotlib useful for: Data visualization Data analysis Scientific computing Statistics Machine Learning resu……

Premium This card is part of the premium lesson. Unlock

Installing Matplotlib

Official installation can be done with pip, for example: python……

Premium This card is part of the premium lesson. Unlock
Important

Matplotlib alias: plt…

Premium This card is part of the premium lesson. Unlock
Remember

import matplotlib.pyplot as p……

Premium This card is part of the premium lesson. Unlock
Memory Trick

NumPy → np Pandas → pd Matplotlib pypl……

Premium This card is part of the premium lesson. Unlock

What is Pyplot?

pyplot என்பது Matplotlib-ல் plotting functions access செய்ய commonly used inte……

Premium This card is part of the premium lesson. Unlock

X-Axis and Y-Axis

Graph-க்கு பொதுவாக இரண்டு axe……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

x = [1, 2, 3] y = [50, 70, 90……

Premium This card is part of the premium lesson. Unlock
Explanation

days = [1, 2, 3, 4, 5] marks = [50, 60, 70, 80……

Premium This card is part of the premium lesson. Unlock

plt.plot()

Definition

plt.plot() primarily plots y vers……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

plt.plot( [1, 2, 3], [10, 20,……

Premium This card is part of the premium lesson. Unlock
Important

X and Y sequences normally need corresponding da……

Premium This card is part of the premium lesson. Unlock
Common Mistake

Wrong: x = [1, 2, 3] y = [10, 20] plt.p……

Premium This card is part of the premium lesson. Unlock

Plot with Only Y Values

Program
Example
Explanation

y = [10, 20, 30, 40] plt.plot(y) plt.show() If only Y dat……

Premium This card is part of the premium lesson. Unlock
Concept

x → 0 1 2 3 y →10 20 30 40…

Premium This card is part of the premium lesson. Unlock

Markers

Markers show individual data ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

plt.plot( x, y, marker="o" ) ……

Premium This card is part of the premium lesson. Unlock
Explanation

x = [1, 2, 3, 4] y = [10, 20, 15, 30] plt.plo……

Premium This card is part of the premium lesson. Unlock
Important

Common markers: o → Circle s ……

Premium This card is part of the premium lesson. Unlock
Important

- → Star - → Plus…

Premium This card is part of the premium lesson. Unlock
Important

x → X marker . → Point Matplotlib plot() accepts……

Premium This card is part of the premium lesson. Unlock

Line Style

Explanation
Example

plt.plot( x, y, linestyle="--……

Premium This card is part of the premium lesson. Unlock
List

- → Solid…

Premium This card is part of the premium lesson. Unlock
Explanation

-- → Dashed -. → Dash-dot : → D……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

Circle markers Dashed connect……

Premium This card is part of the premium lesson. Unlock

Line Width

plt.plot( x, y, linewidth=3 )……

Premium This card is part of the premium lesson. Unlock

Figure Title

Use: plt.title("Student Marks……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

x = [1, 2, 3] y = [70, 80, 90] plt……

Premium This card is part of the premium lesson. Unlock

X-Axis Label

plt.xlabel("Days")…

Premium This card is part of the premium lesson. Unlock

Y-Axis Label

plt.ylabel("Marks")…

Premium This card is part of the premium lesson. Unlock
Explanation

days = [1, 2, 3, 4] marks = [60, 70, 75, 90] plt.plot(da……

Premium This card is part of the premium lesson. Unlock

Title → Student Progress X-ax……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.title("Student Progress") Graph heading.……

Premium This card is part of the premium lesson. Unlock
Memory Trick

TXY T → Title X → X label Y →……

Premium This card is part of the premium lesson. Unlock

Grid

Grid lines help read graph values. plt.grid……

Premium This card is part of the premium lesson. Unlock
Explanation

x = [1, 2, 3, 4] y = [20, 30,……

Premium This card is part of the premium lesson. Unlock

Multiple Lines in One Graph

Explanation
Example

Student A: 60 70 80 Student B……

Premium This card is part of the premium lesson. Unlock
Explanation

x = [1, 2, 3] a = [60, 70, 80] b = [50, 75, 90……

Premium This card is part of the premium lesson. Unlock

Legend

Legend identifies each plotte……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

plt.plot( x, a, label="Arun" ……

Premium This card is part of the premium lesson. Unlock
Explanation

days = [1, 2, 3] arun = [70, 80, 90] bala = [60, 75, 85] plt.plot( days, arun, label="Ar……

Premium This card is part of the premium lesson. Unlock
Important

label= defines series name. l……

Premium This card is part of the premium lesson. Unlock
Memory Trick

label → Name it legend → Show……

Premium This card is part of the premium lesson. Unlock

Definition

Line plot connects data points using lines. Useful fo……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.plot(x, y)…

Premium This card is part of the premium lesson. Unlock
Explanation

months = [1, 2, 3, 4] sales = [100, 150, 140, 200] plt.plot( mont……

Premium This card is part of the premium lesson. Unlock

Definition

Bar chart categorical values compare செய்ய பயன்படுகிறது. O……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

Arun → 90 Bala → 75 Kumar → 85 plt.bar(x, height) ……

Premium This card is part of the premium lesson. Unlock
Explanation

students = [ "Arun", "Bala", "Kumar" ] marks = [ 90, 75, 85 ] plt.……

Premium This card is part of the premium lesson. Unlock
Concept

Marks 90 | █ 80 | █ █ 70 | █ ……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.bar( students, marks ) st……

Premium This card is part of the premium lesson. Unlock
Important

Bar chart useful for: Category comparison Examples: ……

Premium This card is part of the premium lesson. Unlock

Horizontal Bar Chart

Use: plt.barh(x, values)…

Premium This card is part of the premium lesson. Unlock
Explanation
Example

plt.barh( students, marks ) B……

Premium This card is part of the premium lesson. Unlock

Definition

Scatter plot uses individual markers to show relationship/distribution betwe……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.scatter(x, y)…

Premium This card is part of the premium lesson. Unlock
Explanation

hours = [1, 2, 3, 4, 5] marks = [45, 55, 65, 78, 90] plt.scatter( h……

Premium This card is part of the premium lesson. Unlock
Simple Explanation

Points: (1,45) (2,55) (3,65) (4,78) (5,90) No need t……

Premium This card is part of the premium lesson. Unlock
Comparison
Line vs Scatter

Definition

Pie chart ஒரு whole-ஐ slices/fractions ஆக represent செய்கிறது.……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.pie(values) With labels:…

Premium This card is part of the premium lesson. Unlock
Explanation

subjects = [ "Python", "Java"……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.title("Course Selection")……

Premium This card is part of the premium lesson. Unlock
Important

Total: 50 + 30 + 20 = 100 Pie……

Premium This card is part of the premium lesson. Unlock

Percentage in Pie Chart

Use: autopct="%1.1f%%"…

Premium This card is part of the premium lesson. Unlock
Explanation
Example

plt.pie( students, labels=subjects, autopct="%1……

Premium This card is part of the premium lesson. Unlock
Concept

Python 50.0% Java 30.0% C 20.……

Premium This card is part of the premium lesson. Unlock

Explode in Pie Chart

One slice highlight செய்ய: explode = [0.1, 0, 0] Then: plt.pie( students, la……

Premium This card is part of the premium lesson. Unlock

Definition

Histogram numerical data distribution-ஐ intervals or bins ஆக divide செய்து f……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.hist(data) Specify bins:…

Premium This card is part of the premium lesson. Unlock
Explanation

marks = [ 45, 50, 52, 60, 65,……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.xlabel("Marks") plt.ylabel("F……

Premium This card is part of the premium lesson. Unlock
Simple Explanation

Suppose marks: 41-50 → 2 students 51-60 → 2 students 61-70……

Premium This card is part of the premium lesson. Unlock
Important

bins means: How data range is divided into intervals/grou……

Premium This card is part of the premium lesson. Unlock
Comparison
Bar Chart vs Histogram

Figure

Definition

A Figure is the overall drawing/container that holds one or more plotting are……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.figure() plt.plot( [1, 2,……

Premium This card is part of the premium lesson. Unlock

Figure Size

figsize controls the figure dim……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

plt.plot( [1, 2, 3], [10, 20,……

Premium This card is part of the premium lesson. Unlock
Memory Trick

figsize = Figure Size…

Premium This card is part of the premium lesson. Unlock

Figure vs Axes

This is one of the most important Matplotlib concepts. Think: Figure ┌─────────────────────────┐ │ │ │ A……

Premium This card is part of the premium lesson. Unlock
Important

Students often think: Axes = only X-axis + Y-axis That is incomplete. In ……

Premium This card is part of the premium lesson. Unlock

Object-Oriented Method

A very common modern pattern: fig, ax = plt.sub……

Premium This card is part of the premium lesson. Unlock
Explanation

x = [1, 2, 3] y = [10, 20, 30] fig, ax = plt.subplots() a……

Premium This card is part of the premium lesson. Unlock
Explanation

fig, ax = plt.subplots() Creates: fig → Figure ax → Axes ax.plot(x, y……

Premium This card is part of the premium lesson. Unlock
Comparison

Pyplot Style vs Object-Oriented Style Pyplot: plt.plot(x, y) plt.title("Graph") Object-Oriented: fig, ax = pl……

Premium This card is part of the premium lesson. Unlock

Subplots

Definition

Subplots means: Multiple graphs inside one figure. ……

Premium This card is part of the premium lesson. Unlock
Explanation

x = [1, 2, 3] y1 = [10, 20, 30] y2 = [30, 20, 10] fig, axes = plt.subplots(……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.subplots(1, 2) means: 1 r……

Premium This card is part of the premium lesson. Unlock
Dry Run

Figure ┌────────────┬────────────┐ │ Axe……

Premium This card is part of the premium lesson. Unlock
Explanation

2 × 2 Subplots fig, axes = plt.subplots( 2, 2 ) Total: 2 ……

Premium This card is part of the premium lesson. Unlock

Saving a Graph

Use: plt.savefig("graph.png") Official savefig() saves the current figure to an image or v……

Premium This card is part of the premium lesson. Unlock
Explanation

x = [1, 2, 3] y = [10, 20, 30] p……

Premium This card is part of the premium lesson. Unlock
Important

Common save extensions include: .png .pdf .svg savefig() c……

Premium This card is part of the premium lesson. Unlock

DPI

DPI: Dots Per Inch Save:…

Premium This card is part of the premium lesson. Unlock
Memory Trick

Higher DPI → More output pixe……

Premium This card is part of the premium lesson. Unlock

Axis Limits

Set X range: plt.xlim(0, 10) ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

plt.xlim( 0, 5 ) plt.ylim( 0,……

Premium This card is part of the premium lesson. Unlock

Tick Marks

Custom X ticks: plt.xticks( [1, 2, 3,……

Premium This card is part of the premium lesson. Unlock

NumPy with Matplotlib

NumPy and Matplotlib commonly……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

plt.plot(x, y) plt.show()…

Premium This card is part of the premium lesson. Unlock
Program
Graph represents

Pandas with Matplotlib

Pandas DataFrame values can b……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

data = { "Name": [ "Arun", "B……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.bar( df["Name"], df["Mark……

Premium This card is part of the premium lesson. Unlock
Flow

Pandas DataFrame ↓ Select col……

Premium This card is part of the premium lesson. Unlock
Comparison
NumPy vs Pandas vs Matplotlib
Memory Trick

NPM Flow NumPy ↓ Numbers Pand……

Premium This card is part of the premium lesson. Unlock

Important Plot Types

Matplotlib's official plot-type refer……

Premium This card is part of the premium lesson. Unlock
Comparison

Which Graph Should I Use? Trend over time: Line Plot Compare categories: Ba……

Premium This card is part of the premium lesson. Unlock
Important

Complete Basic Plot import matplotlib.pyplot as plt x = [1, 2, 3, 4] y = [60, 70, 80, 90] plt.p……

Premium This card is part of the premium lesson. Unlock
Explanation

plt.plot(...) Creates plot. marker="o" Circle marker. label="Marks" Series label. plt.title(...) Graph ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 1

Wrong Import Wrong: import matplotlib pyplot as plt C……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 2

Plt instead of plt Wrong: Plt.plot(……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 3

Missing Comma in Lists Wrong: pl……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 4

plt show Wrong: plt show() Co……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 5

plt.show Without Call plt.show Thi……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 6

List Object Is Not Callable Suppose student writes: plt.plot = [1, 2, 3] Now plt.plot function name has been ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 7

plt.newfig() Wrong: plt.newfig() There is no standard pyplot ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 8

plt.new figure() Wrong: plt.new figure() Pyth……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 9

Different X and Y Length Wrong: x = [1, 2, 3] y = [10, 20] plt.plot(x, y) Bo……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 10

Bar and Histogram Same என்று நினைப்பது Bar: plt.bar() Category comparison. Histogram: plt.hist() Numerica……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 11

plot() and scatter() Same என்று நினைப்பது Line: plt.plot(x……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 12

Save After Closing Safer order when both saving and displaying: plt.savefig("graph……

Premium This card is part of the premium lesson. Unlock
Memory Trick

Matplotlib Master Memory P T X Y G L S P → Plot T → Title X → X label Y → Y label ……

Premium This card is part of the premium lesson. Unlock
Memory Trick

Plot-Type Memory L B S P H L ……

Premium This card is part of the premium lesson. Unlock
Memory Trick

Graph Selection Trend → Line Compare → B……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 1

Matplotlib is a Python visualization libr……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 2

Common import: import matplot……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 3

Common alias: plt…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 4

Line plot: plt.plot()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 5

Bar chart: plt.bar()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 6

Scatter plot: plt.scatter()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 7

Pie chart: plt.pie()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 8

Histogram: plt.hist()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 9

Graph display: plt.show()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 10

Graph title: plt.title()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 11

X-axis label: plt.xlabel()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 12

Y-axis label: plt.ylabel()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 13

Grid: plt.grid()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 14

Legend: plt.legend()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 15

New Figure: plt.figure()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 16

Subplots: plt.subplots()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 17

Save figure: plt.savefig()…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 18

figsize controls Figure size.…

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 19

bins is an important histogra……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 20

autopct can show percentages ……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 21

Figure is the overall plottin……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 22

Axes is the actual plotting a……

Premium This card is part of the premium lesson. Unlock
TRB Point
TRB Point 23

fig, ax = plt.subplots() crea……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 1

What is Matplotlib? Answer Matplotlib is a Python library for creating visualiz……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 2

What is pyplot? Answer pyplot is a Matplotlib plotting interface that p……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 3

What does plt.plot() do? Answer plt.plo……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 4

What does plt.show() do? Answer It requests di……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 5

What is the difference between a Figure and Axes? Answer A Figure is the ……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 6

What is the difference between bar chart and histogram? Answer A bar chart compares ……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 7

What is the difference between line plot and scatter plot? Answer A line plot normally connects ……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 8

What is a subplot? Answer A subplot is one plotting area withi……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 9

How do you save a Matplotlib graph? Answer Use: plt.sav……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question 10

What is a histogram bin? Answer A bin represents an interval us……

Premium This card is part of the premium lesson. Unlock
MCQ

Matplotlib is mainly used for:…

Premium This card is part of the premium lesson. Unlock
MCQ 2

Which is the common import? A. import matplotlib as pd B. i……

Premium This card is part of the premium lesson. Unlock
MCQ

Common pyplot alias is:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which function creates a comm……

Premium This card is part of the premium lesson. Unlock
MCQ

Which displays the plot?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which creates a vertical bar ……

Premium This card is part of the premium lesson. Unlock
MCQ

Which creates a scatter plot?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which creates a pie chart?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which creates a histogram?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which adds X-axis label?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which adds Y-axis label?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which adds graph title?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which displays legend informa……

Premium This card is part of the premium lesson. Unlock
MCQ

Which displays grid lines?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which creates a new Figure?…

Premium This card is part of the premium lesson. Unlock
MCQ 16

What is the correct command? A. plt show() B……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is best for categorical……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is best for numerical f……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is best to study relati……

Premium This card is part of the premium lesson. Unlock
MCQ

What does bins commonly contr……

Premium This card is part of the premium lesson. Unlock
MCQ

Which method saves a figure?…

Premium This card is part of the premium lesson. Unlock
MCQ

What does this create? fig, a……

Premium This card is part of the premium lesson. Unlock
MCQ

What does this mean? plt.subp……

Premium This card is part of the premium lesson. Unlock
MCQ

Which graph commonly shows pa……

Premium This card is part of the premium lesson. Unlock
MCQ

Which option can show percent……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 1

Create a line plot: x = 1,2,3,4 y = 10,20,30,40 Answer: imp……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 2

Add circle markers. plt.plot(……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 3

Add title: plt.title( "My Fir……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 4

Add labels: plt.xlabel( "X Va……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 5

Add grid: plt.grid()…

Premium This card is part of the premium lesson. Unlock
Practice
Practice 6

Create Bar Chart: import matplotlib.pyplot as plt na……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 7

Create Scatter Plot: x = [1, 2, 3,……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 8

Create Pie Chart: values = [ 50, 30, 20 ] labels = ……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 9

Create Histogram: marks = [ 40, 45, 50, 5……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 10

Create two lines with legend. x = [1, 2, 3] a = [10, 20, 30] ……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 11

Create a new Figure: plt.figu……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 12

Save graph: plt.savefig( "myg……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 13

Create Figure and Axes: fig, ax = pl……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 14

Create 1 × 2 subplots. fig, a……

Premium This card is part of the premium lesson. Unlock
Practice
Practice 15

Choose the correct graph: Student marks by subject: Bar Chart Daily temperature tr……

Premium This card is part of the premium lesson. Unlock
Summary

Matplotlib is a Python visualization library. pyplot provides convenient plotting functions. Common alias is ……

Premium This card is part of the premium lesson. Unlock
Quick Revision

Matplotlib → Visualization Import → import matplotlib.pyplot as plt Alias → plt Line → plt.plot() Bar → plt.b……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program