aboutsummaryrefslogtreecommitdiff
path: root/ee/tools/read_ltspice_raw.py
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-07-10 09:07:52 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-07-10 09:07:52 +0200
commitfb3fe7200c129bb23777ebb2a09bf86f7644bffd (patch)
treea4383237c1f61445c92dc1fb87efc35e9344186b /ee/tools/read_ltspice_raw.py
parent5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db (diff)
downloadee-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.py6
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")