Created
June 4, 2017 01:29
-
-
Save DaisukeMiyamoto/ecda3907c2d2c3cf3eccec8980809a1d to your computer and use it in GitHub Desktop.
generate plot image from data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import sys | |
| argvs = sys.argv | |
| argc = len(argvs) | |
| if(argc != 3): | |
| print 'Usage : ./%s (input_filename) (output_image)' % (argvs[0]) | |
| quit() | |
| targetfile = argvs[1] | |
| outimage = argvs[2] | |
| data = np.loadtxt(targetfile, skiprows=3) | |
| t = data[:,0] | |
| i = data[:,1] | |
| v = data[:,2] | |
| plt.subplot(211) | |
| #plt.rcParams['font.size'] = 15 | |
| plt.xlabel("t [msec]") | |
| plt.ylabel("Injected Current [uA]") | |
| plt.ylim([-1.0,2.0]) | |
| plt.plot(t, i) | |
| plt.subplot(212) | |
| plt.xlabel("t [msec]") | |
| plt.ylabel("Membrane Potential [mV]") | |
| plt.ylim([-70,0]) | |
| plt.plot(t, v) | |
| plt.savefig(outimage) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment