|
5 | 5 | from ..readwrite import _signals
|
6 | 6 | from ..readwrite import annotations
|
7 | 7 |
|
| 8 | + |
8 | 9 | # Plot a WFDB Record's signals
|
9 | 10 | # Optionally, overlay annotation locations
|
10 | 11 | def plotrec(record=None, title = None, annotation = None, timeunits='samples', sigstyle='', annstyle='r*', figsize=None, returnfig = False, ecggrids=[]):
|
@@ -286,11 +287,11 @@ def checkplotitems(record, title, annotation, timeunits, sigstyle, annstyle):
|
286 | 287 | if timeunits == 'samples':
|
287 | 288 | tann[ch] = annplot[ch]
|
288 | 289 | elif timeunits == 'seconds':
|
289 |
| - tann[ch] = annplot[ch]/record.fs |
| 290 | + tann[ch] = annplot[ch]/float(record.fs) |
290 | 291 | elif timeunits == 'minutes':
|
291 |
| - tann[ch] = annplot[ch]/record.fs/60 |
| 292 | + tann[ch] = annplot[ch]/float(record.fs)/60 |
292 | 293 | else:
|
293 |
| - tann[ch] = annplot[ch]/record.fs/3600 |
| 294 | + tann[ch] = annplot[ch]/float(record.fs)/3600 |
294 | 295 | else:
|
295 | 296 | tann = None
|
296 | 297 | annplot = [None]*record.nsig
|
@@ -370,11 +371,11 @@ def checkannplotitems(annotation, title, timeunits):
|
370 | 371 | if timeunits == 'samples':
|
371 | 372 | plotvals = annotation.sample
|
372 | 373 | elif timeunits == 'seconds':
|
373 |
| - plotvals = annotation.sample/annotation.fs |
| 374 | + plotvals = annotation.sample/float(annotation.fs) |
374 | 375 | elif timeunits == 'minutes':
|
375 |
| - plotvals = annotation.sample/(annotation.fs*60) |
| 376 | + plotvals = annotation.sample/float(annotation.fs*60) |
376 | 377 | elif timeunits == 'hours':
|
377 |
| - plotvals = annotation.sample/(annotation.fs*3600) |
| 378 | + plotvals = annotation.sample/float(annotation.fs*3600) |
378 | 379 |
|
379 | 380 | # title
|
380 | 381 | if title is not None and not isinstance(title, str):
|
|
0 commit comments