From 2ceacc0a90366da157c241d21bbc9c2972e8c950 Mon Sep 17 00:00:00 2001 From: klaute Date: Sun, 25 Sep 2016 17:18:43 +0200 Subject: [PATCH] Labels added to the graphical output. --- tools/2m_scan.bat | 2 +- tools/meas.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/2m_scan.bat b/tools/2m_scan.bat index 43f3d5c..8e0db3c 100644 --- a/tools/2m_scan.bat +++ b/tools/2m_scan.bat @@ -1,5 +1,5 @@ @echo off -C:\Python27\python.exe meas.py -o 2m.csv -s 144000000 -e 146100000 -i 1 -p 5000 -d COM16 -m +C:\Python27\python.exe meas.py -o 2m.csv -s 144000000 -e 146100000 -i 1 -p 5000 -d COM16 -m -g pause diff --git a/tools/meas.py b/tools/meas.py index 619adb6..9516aaf 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -528,8 +528,8 @@ if __name__ == "__main__": min_vswr[0] = vswr min_vswr[1] = m[0] # the frequency - # R = meas_data[0] * 5V / 1023 * I - r = 50.0 * vswr # (m[1] * 5.0 / 1023.0) / i + # impedance + r = 50.0 * vswr meas_r.append(r) # P = meas_data[0] * 5V ^ 2 / r @@ -549,9 +549,11 @@ if __name__ == "__main__": print "Output file " + args.output_file + " written." if args.show_graph == True: - plt.plot(meas_freq, meas_ratio) - plt.plot(meas_freq, meas_r) - plt.plot(meas_freq, meas_p) + lv, = plt.plot(meas_freq, meas_ratio, label='VSWR') + lr, = plt.plot(meas_freq, meas_r, label='Impedance') + lw, = plt.plot(meas_freq, meas_p, label='Watt') + + plt.legend(handles=[lv, lr, lw]) print "Please close the mathplot window to exit..." plt.show()