concentracao.py 545 Bytes
Newer Older
Matheus Müller's avatar
Matheus Müller committed
1
2
from pylab import *

3
u = 0
Matheus Müller's avatar
Matheus Müller committed
4

5
6
7
def montaperfil( x, y , step, modo):

    profundidade = arange(0, len(x), step)
Matheus Müller's avatar
Matheus Müller committed
8
9
10
11
12
    concent = profundidade*0

    if modo == 'step':
        global u
        for i in x:
13
            for j in arange (u, i, step):
Matheus Müller's avatar
Matheus Müller committed
14
15
16
17
18
19
                concent[int(j/step)] = y[i]
            u = i

    if modo == 'reta':
        global u
        for i in x:
20
            for j in arange (u, i, step):
Matheus Müller's avatar
Matheus Müller committed
21
22
23
24
25
                concent[int(j/step)] = (j-u)*(y[i]-y[u])/(x[i]-x[u])
            u = i        

    plot(profundidade, concent)
    show()