aboutsummaryrefslogtreecommitdiff
path: root/ee/tools/read_ltspice_raw.py
diff options
context:
space:
mode:
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")