- Author:
- Alan Garny <agarny@hellix.com>
- Date:
- 2021-06-11 09:51:39+12:00
- Desc:
- Removed CSV that can be regenerated.
Figure1.csv and Figure2.csv can be generated by running Figure1.sedml and Figure2.sedml, respectively, and then exporting the simulation results to CSV. So, no need for those CSV files to be tracked.
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/648/rawfile/4e662cb87f8569d10d40251b876798d0d92f68f7/Figure1-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('Figure1.csv')
# define the x and y axis and match the units
X = data[data.keys()[0]] * 1000
Y1 = data[data.keys()[1]]
Y2 = data[data.keys()[2]] * 1e6
plt.figure(figsize=(10, 7))
plt.subplot(2, 1, 1)
plt.plot(X, Y1, 'navy', linestyle='-', label='', linewidth=3)
plt.xlim(0, 1600, 1000)
plt.yticks(np.arange(-70, 40, 20))
plt.ylabel('V$_m$ (mV)', fontsize=12)
plt.title('A', loc='left', y=1.05, x=-0.06, fontsize=20)
plt.grid()
plt.tight_layout()
plt.subplot(2, 1, 2)
plt.plot(X, Y2, 'navy', linestyle='-', label='', linewidth=3)
plt.xlim(0, 1600, 1000)
plt.yticks(np.arange(50, 300, 50))
plt.ylabel('[Ca$^{2+}$]$_i$ (nM)', fontsize=12)
plt.xlabel('Time (ms)', fontsize=12)
plt.title('B', loc='left', y=1.05, x=-0.06, fontsize=20)
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.savefig('figure1.png')
plt.show()