{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Plot ectopic beats\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Nicolas Legrand \n# Licence: Apache-2.0\n\nfrom systole.plots import plot_ectopic" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Visualizing ectopic subspace from RR time series\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from systole import import_rr\n\n# Import PPG recording as numpy array\nrr = import_rr().rr.to_numpy()\n\nplot_ectopic(rr, input_type=\"rr_ms\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Visualizing ectopic subspace from the `artefact` dictionary generated by :py:func:`systole.detection.rr_artefacts()`\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from systole.detection import rr_artefacts\n\n# Use the rr_artefacts function to find ectopic beats\nartefacts = rr_artefacts(rr)\n\nplot_ectopic(artefacts=artefacts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Using Bokeh as plotting backend\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from bokeh.io import output_notebook\nfrom bokeh.plotting import show\nfrom systole.detection import rr_artefacts\n\noutput_notebook()\n\n# Use the rr_artefacts function to find ectopic beats\nartefacts = rr_artefacts(rr)\nshow(\n plot_ectopic(artefacts=artefacts, backend=\"bokeh\")\n)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.16" } }, "nbformat": 4, "nbformat_minor": 0 }