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
| from matplotlib.pyplot import *
from scipy import ndimage
from time import time
from numpy import *
def affichagegraphique():
tempsinter = time()
for i in range(0,100):
for j in range (0,100):
if j%2 == 0: # Changer la couleur du bord du cercle
cercle = plot([j], [i], "ko")
else:
cercle = plot([j], [i], "wo")
setp(cercle, 'markersize', 3)
if j%2 == 0: # Changer la couleur de l interieur du cercle
couleur,couleur1,couleur2 = 0,0,0
else:
couleur,couleur1,couleur2 = 1,1,1
setp(cercle, 'markerfacecolor',(couleur1,couleur,couleur2)) # formattage du cercle
tempsdelta = time() - tempsinter
print('Durée affichage graphique : ',int(tempsdelta/3600),'h ',int((tempsdelta%3600)/60),'m ',int((tempsdelta-int((tempsdelta%3600)/60)*3600)%60),'s')
tempsinter = time()
title('Matrice')
xlabel('Matrice')
tempsinter = time()
mapblanc = ones((1000,1000,3))
figure('Matrice initiale')
imshow(mapblanc)
affichagegraphique()
show()
tempsdelta = time() - tempsinter
print('Durée appel : ',int(tempsdelta/3600),'h ',int((tempsdelta%3600)/60),'m ',int((tempsdelta-int((tempsdelta%3600)/60)*3600)%60),'s')
tempsinter = time() |