Location: Imtiaz_IP3_2002 @ a4c81e90a907 / Simulation / Fig2 / Fig2_plot.py

Author:
Leyla <noroozbabaee@gmail.com>
Date:
2022-03-21 12:25:40+13:00
Desc:
removed
Permanent Source URI:
https://staging.physiomeproject.org/workspace/763/rawfile/a4c81e90a907c18f898096b3e5b7d52b803d896a/Simulation/Fig2/Fig2_plot.py

import pandas as pd
from sklearn import preprocessing
import numpy as np
import matplotlib.pyplot as plt
# Plot Figure 1A

# prefilename = 'Fig1_A'
# plotting the modified version of Figure 1A
prefilename= 'Fig1_A'
filename = '%s.csv' % prefilename
data = pd.read_csv(filename)
time = data['time']
time = time
vm = data['Vm']
ca_y = data['y']
p_ip3 = data['ip3']
ca_z = data[ 'z' ]
# Data preparation

# Normalize the data
vm_norm = preprocessing.normalize(np.array(vm).reshape(1, -1))
ca_z_norm = preprocessing.normalize(np.array(ca_z).reshape(1, -1))
p_ip3_norm = preprocessing.normalize(np.array(p_ip3).reshape(1, -1))
ca_y_norm = preprocessing.normalize(np.array(ca_y).reshape(1, -1))
vm_norm =  0.1223 + 3*vm_norm

fig, axs = plt.subplots()
labelfontsize = 12
axs.plot(time, vm_norm[0], 'k')
axs.plot(time, p_ip3_norm[0], '#8f8f8f')
axs.plot(time, ca_z_norm[0], '--k')
axs.set_ylabel ('Normalized Parameters', fontsize=labelfontsize)
axs.set_xlabel ('Time [min]', fontsize=labelfontsize)
axs.legend(["Vm","IP3","Ca-c"], loc="upper right")
# axs.set_yticklabels([])
axs.set_title('Phase Plot')
prefilename = 'Figure1_origin'
for i in range(3):
        filename = '%s_%d.csv' % (prefilename, i)
        data = pd.read_csv(filename)
        y_d = data['Curve1']
        x_d =  data['x']
        axs.plot(x_d, y_d,'.')
        axs.set_xlim([ 0, 8 ])
        # axs.set_ylim([-72, -30 ])

plt.show()
plt.savefig('Figure_2A')