From fb3fe7200c129bb23777ebb2a09bf86f7644bffd Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 10 Jul 2017 09:07:52 +0200 Subject: o Adding python2 compatibility. --- ee/tools/read_ltspice_raw.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ee/tools') 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") -- cgit v1.2.3