Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered May 20 '18

AlexYang gravatar image

You can use dyntool to export output file to excel file, then using matlab process excel file.

click to hide/show revision 2
No.2 Revision

You can use dyntool to export output file to excel file, then using matlab process excel file. Or catch dyntool objection, use matplotlib package in python to plot what you want.

click to hide/show revision 3
No.3 Revision

You can use dyntool to export output file to excel file, then using matlab process excel file. Or catch dyntool objection, use matplotlib package in python to plot what you want.

You can refer to this script [search: Extract data with dyntools and plot with matplotlib]:

import dyntools
import matplotlib.pyplot as plt

outfile = r"""test.out"""
chnfobj = dyntools.CHNF(outfile)
short_title, chanid, chandata = chnfobj.get_data()

t = chandata['time']
v = chandata[1]              #based on the channel identifier set in the dynamic simulation

fig = plt.figure()
fig.patch.set_facecolor('0.8')
ax1.plot(t,v,linestyle='-', linewidth=1, color='green',label="Voltage")
plt.grid(linestyle='--', color='grey',linewidth=0.5)
plt.xlabel("Time")
plt.ylabel("Voltage")
plt.legend()
axes = plt.gca()
axes.set_facecolor('w')
axes.set_ylim([0.6,1.2])
axes.set_xlim([0,10])
plt.savefig(r"""figure.pdf""",dpi=fig.dpi,facecolor='0.8')
plt.show()