-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathez_plot.py
More file actions
35 lines (29 loc) · 839 Bytes
/
ez_plot.py
File metadata and controls
35 lines (29 loc) · 839 Bytes
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
31
32
33
34
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import math
koef = 1000
firstlvl = 5000
rounds = 10
totallvl = 100
# x = np.arange(-200, 200)
# mathf = np.exp((-((x)**2))/40.0)
x = np.linspace(-10.0, 10.0, 5000)
coeffs = [ 0.05, 0.25, 0.5, 0.75, 1.0 ]
# decay = 2.0
# mathf = [ x + (c*decay*(0.25 - (x-0.5)**2)) for c in coeffs ]
decay = 2.0
# mathf = [ x + (c*decay*(0.25 - (x-0.5)**2)) for c in coeffs ]
# mathf = [ x - (c*decay*(0.25 - (x-0.5)**2)) for c in coeffs ]
# mathf = [ 5*c*(1.0 - 1.0/(1.0 + x - x**2)) for c in coeffs ]
mathf = [ 1/(((x)*(16))**2*c + 1) for c in coeffs ]
plt.plot(x, mathf[0] , 'r.')
plt.plot(x, mathf[1] , 'g.')
plt.plot(x, mathf[2] , 'b.')
plt.plot(x, mathf[3] , 'y.')
plt.plot(x, mathf[4] , 'k.')
plt.xlabel(r'$x$')
plt.ylabel(r'$f(x)$')
plt.grid(1)
plt.ylim([0,1.2])
plt.show()