- Author:
- nima <nafs080@aucklanduni.ac.nz>
- Date:
- 2021-03-26 09:25:46+13:00
- Desc:
- figure 06 and 07 are updated
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/648/rawfile/506de3694dd9b28f81a1199be8c55d57648493b7/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.grid()
plt.xlim(420, 1100)
plt.ylim(-70,-20)
plt.xlabel ('time(ms)',fontsize=14)
plt.tick_params(axis='both', labelsize=12)
plt.ylabel ('MV$_m$(mV)', fontsize=14)
plt.title('A')
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(420, 1140)
plt.ylim(-0.12, 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.)
# x, y = plot_func.smooth_func(X,Y15,3,1,kind='linear')
# plt.subplot(424)
# plt.plot(x, y, 'navy',linestyle='-', label = 'Transepithelial potential-Current Model', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y14,3,1,kind='linear')
# plt.subplot(424)
# plt.plot(x, y, 'navy', linestyle='--', label = 'Transepithelial potential-Thorsen Model', linewidth= 3)
#
# plt.grid()
# plt.xlim(0, 600)
# #~ plt.ylim(0.0, 0.2)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylabel ('Membrane Potential(mV)', fontsize= 12)
# # plt.title('D')
# plt.legend(loc = 'best', fontsize=12)
#
#
# x, y = plot_func.smooth_func(X,Y2,3,1,kind='linear')
# plt.subplot(423)
# plt.plot(x, y, 'navy' ,linestyle='-', label = 'Basolateral Voltage-Current Model', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y9,3,1,kind='linear')
# plt.subplot(423)
# plt.plot(x, y, 'navy', linestyle='--', label = 'Basolateral Voltage-Thorsen Model', linewidth= 3)
# plt.grid()
# plt.xlim(0, 600)
# #~ plt.ylim(0.0, 0.2)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylabel ('Membrane Potential(mV)', fontsize= 12)
# # plt.title('C')
# plt.legend(loc = 'best', fontsize=12)
# x, y = plot_func.smooth_func(X,Y3,3,1,kind='linear')
# plt.subplot(428)
# plt.plot(x, y, 'navy',linestyle='-', label = 'Glucose-Current Model', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y10,3,1,kind='linear')
# plt.subplot(428)
# plt.plot(x, y, 'navy',linestyle='--', label = 'Glucose-Thorsen Model', linewidth= 3)
# plt.grid()
# plt.xlim(0, 600)
# #~ plt.ylim(0.0, 0.2)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylabel ('Interacellular Concentration(mM)', fontsize= 12)
# # plt.title('H')
# plt.legend(loc = 'best', fontsize=12)
# x, y = plot_func.smooth_func(X,Y4,3,1,kind='linear')
# plt.subplot(425)
# plt.plot(x, y, 'navy', linestyle='-', label = 'Sodium-Current Model', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y11,3,1,kind='linear')
# plt.subplot(425)
# plt.plot(x, y, 'navy', linestyle='--', label = 'Sodium-Thorsen Model', linewidth= 3)
# plt.grid()
# plt.xlim(0, 600)
# # plt.ylim(1, 1.25)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylabel ('Interacellular Concentration(mM)', fontsize= 12)
# # plt.title('E')
# plt.legend(loc = 'best', fontsize=12)
# x, y = plot_func.smooth_func(X,Y5,3,1,kind='linear')
# plt.subplot(426)
# plt.plot(x, y, 'navy',linestyle='-', label = 'Potassium-Current Model', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y12,3,1,kind='linear')
# plt.subplot(426)
# plt.plot(x, y, 'navy',linestyle='--', label = 'Potassium-Thorsen Model', linewidth= 3)
# plt.grid()
# plt.xlim(0, 600)
# plt.ylim(0.92, 1.04)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylabel ('Interacellular Concentration(mM)', fontsize= 12)
# # plt.title('F')
# plt.legend(loc = 'best', fontsize=12)
#
# x, y = plot_func.smooth_func(X,Y6,3,1,kind='linear')
# plt.subplot(427)
# plt.plot(x, y, 'navy',linestyle='-', label = 'Chloride-Current Model', linewidth= 3)
# x, y = plot_func.smooth_func(X,Y13,3,1,kind='linear')
# plt.subplot(427)
# plt.plot(x, y, 'navy',linestyle='--', label = 'Chloride-Thorsen Model', linewidth= 3)
# plt.grid()
# plt.xlim(0, 600)
# #~ plt.ylim(0.0, 0.2)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylabel ('Interacellular Concentration(mM)', fontsize= 12)
# # plt.title('G')
# plt.legend(loc = 'best', fontsize=12)
#
# #~ x, y = plot_func.smooth_func(X,Y,3,1,kind='linear')
# #~ plt.subplot(427)
# #~ plt.plot(x, y, 'k', linestyle='-', label = 'pH')
# #~
# #~ plt.grid()
# #~ plt.xlim(0, 1000)
# #~ plt.ylim(0.0, 0.2)
# #~ plt.xlabel ('time(s)')
# #~ plt.ylabel ('Intracellular_pH')
# #~ plt.title('G')
# #~ plt.legend(loc = 'best')
#
# x, y = plot_func.smooth_func(X,Y7,3,1,kind='linear')
# plt.subplot(421)
# plt.plot(x, y, 'navy', label = 'Apical glucose stimulus', linewidth= 3)
# #~ x, y = plot_func.smooth_func(X,Y14,3,1,kind='linear')
# #~ plt.subplot(427)
# #~ plt.plot(x, y, 'k', linestyle='--', label = 'Paracellular Membrane Potential-Exp')
# plt.grid()
# plt.xlim(0, 600)
# plt.tick_params(axis='both', labelsize=12)
# plt.ylim(0.0, 25)
# plt.xlabel ('time(s)', fontsize= 12)
# plt.ylabel ('Lumen Concentration(mM)', fontsize= 12)
# # plt.title('A')
# plt.legend(loc = 'best', fontsize=12)
#~ legend = ax.legend(loc='upper center', shadow=True)
#~ frame = legend.get_frame()
#~ frame.set_facecolor('0.90')
# Set the fontsize
#~ for label in legend.get_texts():
#~ label.set_fontsize('small')
#~
#~ for label in legend.get_lines():
#~ label.set_linewidth(1.5) # the legend line width
#~ plt.xlim(0, 50)
#~ plt.ylim(0, 0.1)
#~ plt.xlabel ('')
#~ plt.ylabel ('')
#~ plt.title('Results')
#~ plt.xticks(np.arange(min(x), max(x)+1, 50))
#~ plt.legend(loc = 'best', fontsize='medium')
#~ plt.grid()
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)