- Author:
- nima <nafs080@aucklanduni.ac.nz>
- Date:
- 2021-06-19 09:20:54+12:00
- Desc:
- New implementation for the python codes (having 1 script instead of 2)
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/648/rawfile/57608f38fb30c8b276408878e179457dc3133bfc/Figure4-plot.py
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# read the csv file extracted from sedml file
data = pd.read_csv('Fig04.csv')
# define the x and y axis and match the units
X1 = data[data.keys()[5]]*1000
Y1 = data[data.keys()[0]]
Y2 = data[data.keys()[1]]
Y3 = data[data.keys()[2]]
Y4 = data[data.keys()[3]]
Y5 = data[data.keys()[4]]
plt.figure(figsize=(14,12))
plt.plot(X1, Y1, 'navy',linestyle='-', label = 'Control', linewidth= 3)
plt.plot(X1, Y2, 'red',linestyle='-', label = 'Block 30%', linewidth= 3)
plt.plot(X1, Y3, 'green',linestyle='-', label = 'Block 70%', linewidth= 3)
plt.plot(X1, Y4, 'purple',linestyle='-', label = 'Block 90%', linewidth= 3)
plt.plot(X1, Y5, 'black',linestyle='-', label = 'Block 100%', linewidth= 3)
plt.grid()
plt.xlim(0, 1900)
plt.ylim(-60,30)
plt.xticks(np.arange(0,1900, 200))
plt.yticks(np.arange(-60,35, 10))
plt.xlabel ('Time (ms)',fontsize=16)
plt.tick_params(axis='both', labelsize=14)
plt.ylabel ('V$_m$ (mV)', fontsize=16)
plt.legend(bbox_to_anchor=(0.3, 0.9, 0.2, 0.07), loc='best',fontsize=14,
ncol=1, mode="expand", borderaxespad=0.)
plt.tight_layout(pad=0.5, w_pad=3, h_pad=3)
plt.savefig('figure4.png')
plt.show()