Labels added to the graphical output.

This commit is contained in:
klaute 2016-09-25 17:18:43 +02:00
bovenliggende fdf31f0ce3
commit 2ceacc0a90
2 gewijzigde bestanden met toevoegingen van 8 en 6 verwijderingen

Bestand weergeven

@ -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

Bestand weergeven

@ -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()