1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| import tkinter as tk
from tkinter import messagebox
import numpy as np
import matplotlib.pyplot as plt
numbers = [1,0,0,0,2]
print(np.poly1d(numbers))
poly = np.poly1d(numbers)
my_Affichage1 = messagebox.askyesno(title= 'Formulation', message = 'Le polynôme est-il ? \n'
'{}'.format(poly))
if my_Affichage1 is False:
tk.messagebox.showerror(title = 'Catalogue_Erreur', message= 'Formule = ')
else :
xx = np.linspace(-10, 10, 100)
yy = poly(xx)
plt.plot(xx, yy, lw = 1, c = "green")
plt.xlabel('Abscisse X')
plt.ylabel('Ordonnée Y')
#plt.legend()
plt.title("Fonction = " '{}'.format(poly))
plt.show() |
Partager