-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphIt.py
More file actions
36 lines (31 loc) · 1.03 KB
/
graphIt.py
File metadata and controls
36 lines (31 loc) · 1.03 KB
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
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
# essentially will be a graphing module
def plot(network, saveFile=None, points=None, *names): # come back to points
if len(names) == 0:
graph = [(i, s) for i, s in enumerate(network.substrates)]
else:
graph = []
for i, s in enumerate(network.substrates):
if s.name in names:
graph.append((i, s))
y0 = network.getInitialValues()
time = np.linspace(0, 200, 200)
y = odeint(network.diffEQs, y0, time)
plt.figure(figsize=(6,4),dpi=100)
for tup in graph:
plt.plot(time,y[:,tup[0]],label=tup[1].name)
plt.tick_params(direction='in',labelsize=12)
plt.xlabel('Time [mins]',fontsize=12)
plt.ylabel('Concentration [AU]',fontsize=12)
plt.legend(loc='right',fontsize=10)
plt.tight_layout()
if saveFile == None:
plt.show()
else:
plt.savefig(f'{saveFile}.pdf', format='pdf')
def diagram(network, saveFile):
return
def barchart():
return