{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# U/Graph/Categorical Plots Using catPlotter\n", "\n", "The module `cdtg` include basic functions for processing data and generating plots.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import warnings\n", "warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n", "warnings.filterwarnings(\"ignore\", category=FutureWarning)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The function `boxplot` generates plots for a given continuous variable Y, a categorical variable X, and a categorical group variable.\n", "\n", "To create a horizontal box plot:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "\n", "from mtbp3.util.cdtg import catPlotter \n", "\n", "cat_plot = catPlotter(None, x_col='Group', y_col='Value', y_scale_base=5, title='An Example')\n", "cat_plot.boxplot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "To create a line plot:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cat_plot.update_parameters(group_col='CValueGroup', x_col='CValue', title='Another Example')\n", "cat_plot.lineplot()" ] } ], "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.10.13" } }, "nbformat": 4, "nbformat_minor": 4 }