Location: Blood HbO2 and HbCO2 Dissociation Curves @ f725b6864f22 / Figure03_plot.py

Author:
nima <nafs080@aucklanduni.ac.nz>
Date:
2020-10-29 09:32:37+13:00
Desc:
All the Cellml files, Sedml files and python scripts for figures are added
Permanent Source URI:
https://models.cellml.org/workspace/607/rawfile/f725b6864f22a00138a2c2455308142c8baba373/Figure03_plot.py

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy import interpolate
import math
import sys
# import plot_func

# reload (plot_func)
import os


data1 = pd.read_csv('pH(6.92).csv')
data2 = pd.read_csv('pH(7.24).csv')
data3 = pd.read_csv('pH(7.56).csv')

x1_name = "main/pO2"
y1_name = "main/SHbO2"
x2_name = "main/pO2"
y2_name = "main/SHbO2"
x3_name = "main/pO2"
y3_name = "main/SHbO2"

#
# x2_name = "main/pCO2"
# y2_name = "main/n2"
# #
# x3_name = "main/DPG"
# y3_name = "main/n3"
#
# x4_name = "main/Temp"
# y4_name = "main/n4"


X1 = data1[x1_name]
Y1 = data1[y1_name]

X2 = data2[x2_name]
Y2 = data2[y2_name]

X3 = data3[x3_name]
Y3 = data3[y3_name]
# #
# X4 = data4[x4_name]
# Y4 = data4[y4_name]
#
# # Y_values = []
plt.figure(figsize=(6,6))
# plt.subplot(2,2,1)

plt.plot(X1, Y1, 'navy' ,linestyle='-',marker = '', linewidth=3, label = 'pH$_{rbc}$ = 6.92')
plt.plot(X2, Y2, 'green' ,linestyle='-',marker = '', linewidth=3, label = 'pH$_{rbc}$ = 7.24')
plt.plot(X3, Y3, 'red' ,linestyle='-',marker = '', linewidth=3, label = 'pH$_{rbc}$ = 7.56')


plt.xlim(0, 101)
plt.ylim(0, 1)
# plt.yticks(np.arange(0,0.8,0.15))
plt.xticks(np.arange(0, 101, 20))
plt.ylabel ('SHbO$_2$',fontsize=14)
plt.xlabel ('pO$_2$, mmHg',fontsize=14)
plt.grid()
plt.subplots_adjust(bottom=0.5, right=0.8, top=1)
plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=1.0)
plt.title('Hemoglobin-Oxygen dissociation curve', fontsize=14)
plt.legend(loc='upper left')

plt.savefig('Figure03.png')
plt.show()