Skip to content

Commit e8f7625

Browse files
committed
Customize plot styles
1 parent cad4ce8 commit e8f7625

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,39 @@
44

55
## Introduction
66

7-
A Python-native package for reading, writing, processing, and plotting physiologic signal and annotation data.
7+
The WFDB Python package is a Python-native tool for reading, writing, processing, and plotting physiological signal and annotation data. This package is forked from [MIT-LCP/wfdb-python](https://github.com/MIT-LCP/wfdb-python).
88

9-
Forked from [wfdb-python](https://github.com/MIT-LCP/wfdb-python).
9+
## Enhancements
1010

11+
The plotting functions have been extended to include options for:
12+
- Hiding axes
13+
- Customizing line styles
14+
- Changing background colors
15+
16+
These features allow users to create "clean" ECG plots.
17+
18+
## Example Usage
19+
20+
See the [demo.ipynb](https://github.com/shujuecn/wfdb-python/blob/main/demo.ipynb) notebook for example use cases.
21+
22+
```python
23+
# Read WFDB record
24+
rec_path = "./sample-data/s40000306/40000306"
25+
rd_record = wfdb.rdrecord(rec_path)
26+
27+
# Plot with custom styles
28+
wfdb.plot_wfdb(
29+
record=rd_record,
30+
time_units="samples",
31+
figsize=(20, 15),
32+
ecg_grids="", # Remove grid
33+
title=" ", # Empty title
34+
close_axis=True, # Hide axis
35+
line_color="w", # White lines
36+
bg_color="k", # Black background
37+
)
38+
```
39+
40+
This will generate a clean ECG plot, as shown below:
41+
42+
![](./output/ecg_s40000306.jpg)

0 commit comments

Comments
 (0)