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
| #!/usr/bin/python3.1
# -*-coding:Utf-8 -*
#étape suivante connaître les fonctions à l'origine des courbes IMC
# ce serait poids en kg sur taille exprimé en mètre
# x la taille y le poids ? donc y/x**2, sachant que x est compris entre 1.50 et 2.10 et y entre 40 et 130
import numpy as np
import matplotlib.pyplot as plt
plt.clf()
y = np.linspace(40,130,1)
x = np.linspace((1,50),(2,10),1)
imc = (y/x**2)
while imc.all >=float(16.5) and imc.all <=float(18.5):
plt.plot(x,y,imc)
plt.show() # erreur ligne 38 indentation obligatoire
#pas de courbe dessinée
#ne fonctionne pas avec array
#j'essaie avec array
y = np.array([40,130])
x = np.array([(1,50),(2,10)])
imc = (y/x**2)
while imc.all >= float(16.5) and imc.all <= float(18.5):
plt.plot(x,y,imc)
plt.show() # erreur ligne 38 indentation obligatoire |
Partager