-
Notifications
You must be signed in to change notification settings - Fork 0
/
fplotter.py
58 lines (30 loc) · 850 Bytes
/
fplotter.py
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
35
36
37
38
import numpy as np
import matplotlib.pyplot as plt
def plotter(data, start, stop):
x = np.arange(start=start, stop=stop, step=1)
plt.plot(x, data)
plt.xlabel('x')
plt.ylabel('y')
plt.show()
def linear(a, b, start, stop):
"""
:param a: linear coefficient
:param b: constant
:param start: minimum x value
:param stop: maximum x value
"""
data = [a*x + b for x in np.arange(start=start, stop=stop, step=1)]
start = start
stop = stop
plotter(data, start, stop)
def power(a, b, start, stop):
"""
:param a: function order
:param b: constant
:param start: minimum x value
:param stop: maximum x value
"""
data = [x ** a + b for x in np.arange(start=start, stop=stop, step=1)]
start = start
stop = stop
plotter(data, start, stop)