20 lines
308 B
Python
20 lines
308 B
Python
|
import matplotlib.pyplot as plt
|
||
|
import numpy as np
|
||
|
|
||
|
X = np.arange(-1.0, 1.0, 0.025)
|
||
|
|
||
|
a = 9
|
||
|
b = 6
|
||
|
c = 8
|
||
|
|
||
|
Y = (a-4)*(X**2) + (b-5)*X + (c-6)
|
||
|
|
||
|
G = np.exp(X)/(np.exp(X) + 1)
|
||
|
|
||
|
plt.plot(X,Y, 'g', label="F(x) = 5x^2 + x + 2")
|
||
|
plt.plot(X,G, 'y', label="G(x) = e^x/(e^x+1)")
|
||
|
plt.legend(loc="upper left")
|
||
|
|
||
|
plt.show()
|
||
|
|