La lecture en ligne est gratuite
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
Télécharger Lire

Python for Science and Engg: Plotting experimental data (session 2)

De
37 pages
Python for Science and Engg:Plotting experimental dataFOSSEEDepartment of Aerospace EngineeringIIT BombaySciPy 2010, Introductory tutorials,Day 1, Session 2FOSSEE group (IIT Bombay) Plotting with Python 1 / 37Outline1 Plotting Points2 Lists3 Simple Pendulum4 Strings5 SummaryFOSSEE group (IIT Bombay) Plotting with Python 2 / 37Plotting PointsOutline1 Plotting Points2 Lists3 Simple Pendulum4 Strings5 SummaryFOSSEE group (IIT Bombay) Plotting with Python 3 / 37Plotting PointsWhy would I plot f(x)?Do we plot analytical functions or experimental data?In []: time = [0, 1, 2, 3]In []: distance = [7, 11, 15, 19]In []: plot(time,distance)Out[]: []In []: xlabel(’time’)Out[]: In []: ylabel(’distance’)Out[]: object at 0x98746ec>FOSSEE group (IIT Bombay) Plotting with Python 4 / 37Plotting PointsIs this what you have?FOSSEE group (IIT Bombay) Plotting with Python 5 / 37Plotting PointsPlotting pointsWhat if we want to plot the points?In []: clf()In []: plot(time, distance, ’o’)Out[]: []In []: clf()In []: plot(time, distance, ’.’)Out[]: []FOSSEE group (IIT Bombay) Plotting with Python 6 / 37Plotting PointsFOSSEE group (IIT Bombay) Plotting with Python 7 / 37Plotting PointsAdditional Line Styles’o’ - Filled circles’.’ - Small Dots’-’ - Lines’--’ - Dashed ...
Voir plus Voir moins

Vous aimerez aussi

FOSSEEg
Python for Science and Engg: Plotting experimental data
roup(IIT
FOSSEE
Department of Aerospace Engineering IIT Bombay
SciPy 2010, Introductory tutorials, Day 1, Session 2
Bombay)PlottingwithPython1/73
OFEESSuorgitgniwhtyPhtno/2p(IITBombay)Plot
4
Strings
Simple Pendulum
3
Outline
37
2
Lists
1
Plotting Points
5
Summary
olttPsPgnitniotiotPly)baomTBII(puorgEESSOF
1
Plotting Points
2
Lists
4
Strings
5
Summary
Outline
Simple Pendulum
3
/373htnohtyPgniw
inttloPWstnioPgIdluowyhplotf(x)?it(tolpe)nctais,dmec8aa]>0tat37axtl(eimxbelaolltbil.<[ampte2Dobjecines.Linalebysiat(ld0x98ctatc>6e9a.txet.biejbotxeT<)tllotpma>cOFSSEErguo(pIIobjectat0x98746eltolt.bi.txetxeTenc)<tpma
time = [0, 1, 2, 3]
Do we plot analytical functions or experimental data?
In []:
In []: Out[]:
In []: Out[]:
In []:
distance = [7, 11, 15, 19]
In []: Out[]:
374/onthPythwignittolP)yabmoBT
Is
this
FOSSEE
what
group
(IIT
you
Bombay)
Plotting
have?
Points
Plotting
with
Python
5
/
37
PgnittolPjeobac0xatctiotnPsolttnipgiontsF]>c0e71cax0tatcjeobwgtittniP)olbmyaITBoup(IEgroOSSEe017]c>
What if we want to plot the points?
In []:
clf()
tyPh6noh73/
In []: Out[]:
plot(time, distance,’o’) [<matplotlib.lines.Line2D
In []: In []: Out[]:
clf() plot(time, distance,’.’) [<matplotlib.lines.Line2D
FOSSEE
group
(IIT
Bombay)
Plotting
Points
Plotting
with
Python
7
/
37
ylStesalonneLiPlotstdAidititgnoPniniwgtiPhtyoh8n3/7
’o’- Filled circles ’.’- Small Dots -- Lines ’ ’ ’--’- Dashed lines
SOFpuorgEESmbBoIT(Ittlo)Pay
1
Plotting Points
2
Lists
Outline
Simple Pendulum
3
4
Strings
5
Summary
noht73/9iwgnyPhtPly)tiotTBIIbaomuo(pEErgOFSSstLis
tiFPOhStSyEoEhg1rno/u0p7(3I
What arexandy?
ITBombay)Plottingw
15,
19]
In []: distance = [7,
11,
In []: time = [0, 1, 2, 3]
lists!!
nIrtts:sitnodocuLitsisL
mbayITBoup(IEgroSOESF
In []:
In []: Out[]:
3,
p = [ 2,
7]
5,
elements
371/n1hotyPhtiwgnittolP)
p[0]+p[1]+p[-1] 12
In []: mtlist =
p[1] 3
In []: Out[]:
[]
Empty List
iLtssisttiai:snIL&angzilingsiescc
Un pour Un
Permettre à tous d'accéder à la lecture
Pour chaque accès à la bibliothèque, YouScribe donne un accès à une personne dans le besoin