﻿#Tracé d'une courbe#
import numpy as np
import matplotlib.pyplot as plt
x = np.array([T1, T2, T3, T4, T5, T6])
y = np.array([P1, P2, P3, P4, P5, P6])
plt.plot(x, y,"r+",label="Mesures")
plt.xlim(Tmin,Tmax)
plt.ylim(Pmin,Pmax)
plt.title("Evolution de ...")
plt.xlabel("température T en ...")
plt.ylabel("pression P en ...")
plt.show() # affiche la figure a l'ecran

#Modélisation d'une courbe#
from scipy.stats import linregress
(a,b,c,d,e)=linregress(x,y)
plt.plot(x,a*x+b,"b",label="P=a*T+b  "
       +"a="+str(round(a,1))+" Pa.K-1"
       +"  b="+str(round(b,1))+" Pa")
print ("a="+str(round(a,1))+"b"+str(round(b,1)))
plt.legend()