diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-07-10 09:07:52 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-07-10 09:07:52 +0200 |
commit | fb3fe7200c129bb23777ebb2a09bf86f7644bffd (patch) | |
tree | a4383237c1f61445c92dc1fb87efc35e9344186b /ee/tools/read_ltspice_raw.py | |
parent | 5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db (diff) | |
download | ee-python-fb3fe7200c129bb23777ebb2a09bf86f7644bffd.tar.gz ee-python-fb3fe7200c129bb23777ebb2a09bf86f7644bffd.tar.bz2 ee-python-fb3fe7200c129bb23777ebb2a09bf86f7644bffd.tar.xz ee-python-fb3fe7200c129bb23777ebb2a09bf86f7644bffd.zip |
o Adding python2 compatibility.
Diffstat (limited to 'ee/tools/read_ltspice_raw.py')
-rw-r--r-- | ee/tools/read_ltspice_raw.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ee/tools/read_ltspice_raw.py b/ee/tools/read_ltspice_raw.py index 0b3b7e1..279fe73 100644 --- a/ee/tools/read_ltspice_raw.py +++ b/ee/tools/read_ltspice_raw.py @@ -12,7 +12,9 @@ raw = ee.read_ltspice_raw(sys.argv[1]) # for p in raw.values[i]: # print(" {}".format(p)) -xs = raw.get_values('V(load)') +x = raw.get_variable(idx = 0) +y = raw.get_variable(expression = 'V(load)') +xs = raw.get_values(y) import matplotlib matplotlib.use('Agg') @@ -22,6 +24,8 @@ from matplotlib.ticker import FuncFormatter, MaxNLocator fig = plt.figure() ax = fig.add_subplot(111) ax.plot(xs) +ax.set_xlabel(x.expression) +ax.set_ylabel(y.expression) with open("ltspice.png", "wb") as f: plt.savefig(f, format="png") |