1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
   | import scipy.integrate as integrate
import matplotlib.animation as animation
from math import exp
import numpy as np
from pylab import *
import os as os
import matplotlib.image as mpimg
 
os.getcwd()
os.chdir("C:/Users/Quentin/Desktop")
a=mpimg.imread('image qui bouge.bmp')
b=mpimg.imread('fond de matplotib.bmp')
 
x=[]
y=[]
 
xmin = 0
xmax = 5
nbx = 100
 
x = linspace(xmin, xmax, nbx)
 
for z in range (0,50):
    y.append(z/6.67)
    x.append(integrate.simps(59.46*(np.exp(y)-1)/(np.exp(y)+1)))
 
dt=0.0001
fig=figure()
line,=plot([],[],'a',ms=10)
xlim(0,2000)
ylim(-1,1)
 
def init():
    line.set_data([],[],'b')
    return line,
 
def animate(i):
    t=i*dt
    xx=x[i]
    y=0.0
    line.set_data(xx,y)
    return line,
 
ani=animation.FuncAnimation(fig,animate,init_func=init,frames=40,
                            blit=False,interval=100,
                            repeat=False)
 
show() | 
Partager