A python library for plotting ECG graph
-
System dependencies
phantomjs
[Install phantomjs] (http://phantomjs.org/build.html) -
Install dependencies
matplotlib==1.4.0
andnumpy==1.9.2
$ pip install -r requirements.txt
- Download the project and run
setup.py
$ python setup.py install
from pyECG_graph import pyECG
pyECG.generate_ecg_graph(ecg_data='sample_ecg_data.txt', output_dir='/tmp/', export_to='pdf', output_file_name='mygraph')
-
ecg_data:
- Required
- Accepts a valid list containing ECG graph values
- Also accepts a valid data file path
-
output_dir:
- Required
- Valid path where output file is to be placed
-
export_to:
- Exports ECG graph to provided format
- Currently supported formats are 'pdf', 'jpg', 'png'
- Default is 'pdf'. Gives a very nice output.
-
output_file_name:
- name of output file generated
- Default is 'graph'
This will generate mygraph.pdf
in the provided output directory.
See some sample output files generated:
-
[Exported to PDF] (https://github.com/KartikeyaRokde/pyECG_graph/blob/master/pyECG_graph/output/mygraph.pdf)
-
Exported to PNG
![alt text][logo] [logo]: https://github.com/KartikeyaRokde/pyECG_graph/blob/master/pyECG_graph/output/mygraph.png "mygraph.png"
- Exported to JPG
![alt text][logo] [logo]: https://github.com/KartikeyaRokde/pyECG_graph/blob/master/pyECG_graph/output/mygraph.jpg "mygraph.jpg"
That's it. Happy ECG :)