Skip to content

Commit bd39278

Browse files
committed
Added legends to plots
1 parent 2f9d1fa commit bd39278

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

physioqc/metrics/cardiac.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ def cardiacsqi(rawcard, Fs, debug=False):
304304
plt.plot(timeaxis, rawcard)
305305
plt.plot(timeaxis, prefiltered)
306306
plt.title("Raw and prefiltered cardiac signal")
307+
plt.legend(["Raw", "Prefiltered"])
307308
plt.show()
308309
if debug:
309310
print("prefiltered: ", prefiltered)
@@ -318,6 +319,7 @@ def cardiacsqi(rawcard, Fs, debug=False):
318319
if debug:
319320
plt.plot(timeaxis, normderiv)
320321
plt.title("Normalized cardiac signal")
322+
plt.legend(["Normalized cardiac signal"])
321323
plt.show()
322324

323325
# amplitude correct by flattening the envelope function
@@ -334,6 +336,7 @@ def cardiacsqi(rawcard, Fs, debug=False):
334336
plt.plot(timeaxis, esuperior)
335337
plt.plot(timeaxis, -einferior)
336338
plt.title("Normalized cardiac signal, upper and lower envelope")
339+
plt.legend(["Normalized derivative", "Envelope top", "Envelope bottom"])
337340
plt.show()
338341
rmsnormderiv = normderiv / (esuperior + einferior)
339342
if debug:
@@ -545,7 +548,7 @@ def plotcardiacwaveformwithquality(waveform, heartbeatlist, Fs, plottype="rectan
545548
yvals = waveform[startpt : endpt + 1]
546549
plt.plot(xvals, yvals, color=thecolor)
547550
plt.ylim([ymin, ymax])
548-
plt.title("Respiratory waveform, color coded by quantifiability")
551+
plt.title("Cardiac waveform, color coded by quantifiability")
549552
plt.xlabel("Time in seconds")
550553
plt.ylabel("Amplitude (arbitrary units)")
551554
plt.xlim([0.0, len(waveform) / Fs])

0 commit comments

Comments
 (0)