- Author:
- nima <nafs080@aucklanduni.ac.nz>
- Date:
- 2021-05-05 10:08:43+12:00
- Desc:
- Run the model for longer time and capture the results at different time in order to make sure the simulation gets to steady state.
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/648/rawfile/cce2f4422134edf6acdb765a9cdd9ff5e69b3006/Fig03-plot.py
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys
# import plot_func
# reload (plot_func)
import os
#~ root = 'D:/Nima/ABI/Python'
data = pd.read_csv('Fig03.csv')
X_name = 'environment/time'
y1_name = 'Membrane/V'
y2_name = 'i_CaL/i_CaL'
y3_name = 'i_Na/i_Na'
y4_name = 'i_NaK/i_NaK'
y5_name = 'Membrane/i_tot'
y6_name = 'i_Ks/i_Ks'
y7_name = 'i_Kr/i_Kr'
y8_name = 'i_CaT/i_CaT'
y9_name = 'i_f/i_f'
y10_name = 'i_NaCa/i_NaCa'
X1 = data[X_name]*1000
Y1 = data[y1_name]
Y2 = data[y2_name]*1000/57
Y3 = data[y3_name]*1000/57
Y4 = data[y4_name]*1000/57
Y5 = data[y5_name]*1000/57
Y6 = data[y6_name]*1000/57
Y7 = data[y7_name]*1000/57
Y8 = data[y8_name]*1000/57
Y9 = data[y9_name]*1000/57
Y10 = data[y10_name]*1000/57
plt.figure(figsize=(14,14))
# x, y = plot_func.smooth_func(X,Y1,3,1,kind='linear')
plt.subplot(211)
plt.plot(X1, Y1, 'navy',linestyle='-', label = '', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y8,3,1,kind='linear')
# plt.subplot(422)
# plt.plot(x, y, 'navy', linestyle='--', label = 'Apical Voltage-Thorsen Model', linewidth= 3)
# plt.axvline(x=550, label='t$_{MDP}$', colour='black')
plt.grid()
plt.xlim(3692, 4410)
plt.ylim(-70,-25)
plt.xlabel ('time(ms)',fontsize=14)
plt.tick_params(axis='both', labelsize=12)
plt.ylabel ('MV$_m$(mV)', fontsize=14)
plt.title('A')
plt.axvline(x=3745, linewidth=4, label='t$_{MDP}$', color='black')
plt.axvline(x=3845, linewidth=4, label='t$_{MDP}$+100 ms', linestyle='dotted', color='black')
plt.axvline(x=4365, linewidth=4, label='t$_{TOP}$', color='grey')
plt.legend(loc = 'best', fontsize=12)
plt.subplot(212)
plt.plot(X1, Y2, 'navy',linestyle='-', label = 'I$_{CaL}$', linewidth= 3)
plt.plot(X1, Y3, 'red',linestyle='-', label = 'I$_{Na}$', linewidth= 3)
plt.plot(X1, Y4, 'green',linestyle='-', label = 'I$_{NaK}$', linewidth= 3)
plt.plot(X1, Y5, 'black',linestyle='--', label = 'I$_{tot}$', linewidth= 3)
plt.plot(X1, Y6, 'orange',linestyle='-', label = 'I$_{Ks}$', linewidth= 3)
plt.plot(X1, Y7, 'purple',linestyle='-', label = 'I$_{Kr}$', linewidth= 3)
plt.plot(X1, Y8, 'grey',linestyle='-', label = 'I$_{CaT}$', linewidth= 3)
plt.plot(X1, Y9, 'black',linestyle='-', label = 'I$_{f}$', linewidth= 3)
plt.plot(X1, Y10, 'blue',linestyle='-', label = 'I$_{NaCa}$', linewidth= 3)
plt.grid()
plt.xlim(3692, 4410)
plt.ylim(-0.15, 0.2)
plt.xlabel ('time(ms)',fontsize=14)
plt.tick_params(axis='both', labelsize=12)
plt.ylabel ('pA/Pf', fontsize=14)
plt.title('B')
plt.legend(bbox_to_anchor=(0., 1.02, 1., 0.102), loc='best',fontsize=14,
ncol=10, mode="expand", borderaxespad=0.)
plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=1.0)
plt.savefig('C:/Nima/ABI/Physiome Journal/sinus/Python_codes/figure03.png')
plt.show()
#~ plt.legend(loc=0)