0% found this document useful (0 votes)
23 views6 pages

2mark Answers

Matplotlib is a Python library used for 2D plotting of data. It allows for: 1. Representing uncertainty in data points using error bars. 2. Creating 3D plots of data by generating random data and plotting it on 3 axes. 3. Producing scatter plots using the scatter() function, which plots x-data versus y-data with optional colors and markers.

Uploaded by

Kanimozhi L
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)
23 views6 pages

2mark Answers

Matplotlib is a Python library used for 2D plotting of data. It allows for: 1. Representing uncertainty in data points using error bars. 2. Creating 3D plots of data by generating random data and plotting it on 3 axes. 3. Producing scatter plots using the scatter() function, which plots x-data versus y-data with optional colors and markers.

Uploaded by

Kanimozhi L
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/ 6

PART- A (5X 2- 20 MarKs)

ERROR BAR NCTTON IN MATPLOTAIR:


PURpoSE OF
Depçt unentainty datapeins by ahouig eisoihis.
eoch
Bas- Reprcsent vuobibty /wnteitacnty aicund
data pent comthly used
statsbal iaaizatwnà.
Exarmpe?
trnpest matplotlib pPpot as ple
X
O, 2, 3,4)
y C; 4,3,2J
Coi 04,03,oJ # Eor ahuos 4en eochrot
yesa =
plt.

pll xabel (x-mxis'


plt yabel (Y-arsis
PE.
Excimple
plt how l )

Egvrban fxample

45

35

30

2.0t

30 4.
|.5 20 25

X-axis
MATPLOTL|8
3 DIMENSIONAL DRAWING IN
tinpost matplotib pPplot as plt
tiom mplloolkis . mplot 3d
rpoht Axes3D
ripOst
plt fgul)
l!,
ty acd ubplot C
# Gnenalirg data
np. andom.standasd.neima Ioo)
hp. iandom .otadadnpsmal libo)

# Ch2alirg the 3p Matta plot


ar. Aatt er Cx,y. 3, c=4'masko -'b')

OKat- xlatel ('zars')


ak. set -tte (3D attea plot
plt shool )
3D Satta Plot

-2
A IMRTANT TCATURES F MATPIOTIB
wde Hang of plottnq: Natplotib proites a
vahtty of potttg oton 6 ihckrdungaplot
lre plots
ele
Hapob, t ,bas, charh , hstoqams,
(DPubicafo Buabty plot : allbos utmalio
erey aspt a plot- totos toot lebe styles.
o afng
onnot publioto
Qnablotg te scats
quauby gAaphis. f chtegsatee
Tntegiator ws Jupyte noteboks :
) vitaacte plotng
Typles neftbpoki. alleng
anel aligate f data usthcs he
quucb
erribonrnlnt
Multplo lotfoms and 4o tohmat t
ySupport Qekos vasis platom
Matplotlab wnks amlesy
6upo B nuneiCL
and
( WndoUs, malOs, diiuy )

4 SvNTAX C ScATTEB()
usd to (aale a sitca plot
Sateac) -
tmpost matplotlib. PHplct ptae dit o CAayA
T

# Asunuig x-drka acl ydata


data
maskor = 'b' colau
x-data, y data ,
pt-sates Clabel Sattaplot )

i plt xlabel
pt yeabe ('Seata Pot Zrnplo
plt. He
pt.tigerd ()
enabes that
aay wica povides
-to a gt *
tos plotts os lvahaliga
one quaihy
bllo tache stale CHOake tbUxd
ihon lbnay
Py fu visualinatuon Data x
MATPLOTAIB (1)
Tes PlSpeiaized
ot
Drtegtis
cito *
Pandas
4ecteSi
aalgato'
chatng roceis
b. thsinclihes
e >
omplex
quaphiu ötat
shal itoarrte orttacckre
ibnany viaalgat datn pytion A’
SEABORN (6)
DENSITYa CoNaJe lor

dubersia nl kistit byplotng


Repia ent. catrd tortti9.n92dono
ns tan t z lcs
colore bak
plt contouu l x, y,2,

2 3
JNE Pp1

tmpot matpletib pyplotasas npplt


(inpost nuny

(* ) Data fos fut lhe

(8,5))

(lxo,
, lstyb: nlucth s3
ptplol X,y, latel ='So
livstoo=l heoas
CX, y, kabel= lost
plk plot
haskes to Berne pou
#Addue q yC:,'o', colol- Gruen
plot ( xG:10) ,
plt

pltae ('arb )
dit hyla'
tte cdune Pot w'h
pl Lgndc
plt Bhawl)
Plot uih fecnt Shytes

01

You might also like