[e5f1db]: / tests / _scripts / catplot_create_expected_plots.ipynb

Download this file

78 lines (77 with data), 1.6 kB

{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Create expected plots for catplot Tests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import ehrapy as ep"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "current_notebook_dir = %pwd\n",
    "\n",
    "_TEST_DATA_PATH = f\"{current_notebook_dir}/../test_data/dataset1.csv\"\n",
    "_TEST_IMAGE_PATH = f\"{current_notebook_dir}/../plot/_images\"\n",
    "adata_mini = ep.io.read_csv(_TEST_DATA_PATH, columns_obs_only=[\"glucose\", \"weight\", \"disease\", \"station\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig1 = ep.pl.catplot(adata_mini, jitter=False)\n",
    "\n",
    "fig1.savefig(f\"{_TEST_IMAGE_PATH}/catplot_vanilla_expected.png\", dpi=80)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ehrapy_venv_may",
   "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.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}