Bonjour tout le monde,
J'essaye d'afficher deux courbes dans une meme figure mais je ne m'en sors pas.
voici le code que j'ai écrit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
import matplotlib.pyplot as plt
import numpy as np
from openpyxl import load_workbook
from matplotlib.pylab import plot
 
from matplotlib.pylab import arange
wb=load_workbook(r'file111.xlsx')
sheet=wb.get_sheet_by_name('feuille1')
listeX = []
listeY=[]
for i in range (2,6):
     listeX.append(sheet.cell(row=i,column=3).value)
 
for i in range (0,len(listeX)):
 listeX[i]=float(listeX[i])
 listeY.append(listeX[i]** 2-listeX[i]/10)
 print(i,'---- ',listeX[i],' ',listeY[i])
 
plt.plot(listeX,listeY)
plt.show()
 
x = arange(10,12,0.01)
y = 2*x**2-x/5+ 9
plt.plot(x,y)
plt.show()
Merci d'avance