statistical-plot


Namestatistical-plot JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/ChenLiu-1996/StatsPlot
SummaryStatistical plotting with good aesthetics.
upload_time2024-07-26 00:47:44
maintainerNone
docs_urlNone
authorChen Liu
requires_pythonNone
licenseMIT
keywords plotting plot statistical plotting statistical plot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tools for Statistical Plotting

**Chen Liu** @ [Krishnaswamy Lab](https://krishnaswamylab.org/members), Yale University

[![Latest PyPI version](https://img.shields.io/pypi/v/statistical-plot.svg)](https://pypi.org/project/statistical-plot/)
[![PyPI license](https://img.shields.io/pypi/l/statistical-plot.svg)](https://pypi.python.org/pypi/statistical-plot/)
[![PyPI download month](https://img.shields.io/pypi/dm/statistical-plot.svg)](https://pypi.python.org/pypi/statistical-plot/)
[![PyPI download day](https://img.shields.io/pypi/dd/statistical-plot.svg)](https://pypi.python.org/pypi/statistical-plot/)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)

Please kindly **Star** [![Github Stars](https://img.shields.io/github/stars/ChenLiu-1996/StatsPlot.svg?style=social&label=Stars)](https://github.com/ChenLiu-1996/StatsPlot/) this repo for better reach if you find it useful.

## Installation
```
pip install statistical-plot
```

## Example Plots
### Statistical Bar Plot

<img src="assets/sbplot_example.png" height="300"/>



## Usage
### Statistical Bar Plot

```
from statistical_plot import sbplot
fig = plt.figure(figsize=(12, 6))
ax = fig.add_subplot(1, 2, 1)

np.random.seed(1)

method_list = ['method_1', 'method_2', 'method_3']

auroc_data_dict = {
    'method_1': np.clip(np.random.normal(loc=0.92, scale=0.04, size=(10,)), 0, 1),
    'method_2': np.clip(np.random.normal(loc=0.75, scale=0.03, size=(10,)), 0, 1),
    'method_3': np.clip(np.random.normal(loc=0.98, scale=0.02, size=(10,)), 0, 1),
}
auroc_pvals_dict = {
    'method_1 vs method_3': 0.01,
    'method_2 vs method_3': 5e-5,
}

acc_data_dict = {
    'method_1': np.clip(np.random.normal(loc=0.89, scale=0.05, size=(10,)), 0, 1),
    'method_2': np.clip(np.random.normal(loc=0.81, scale=0.04, size=(10,)), 0, 1),
    'method_3': np.clip(np.random.normal(loc=0.94, scale=0.03, size=(10,)), 0, 1),
}
acc_pvals_dict = {
    'method_1 vs method_3': 0.01,
    'method_2 vs method_3': 0.001,
}

f1_data_dict = {
    'method_1': np.clip(np.random.normal(loc=0.92, scale=0.04, size=(10,)), 0, 1),
    'method_2': np.clip(np.random.normal(loc=0.87, scale=0.03, size=(10,)), 0, 1),
    'method_3': np.clip(np.random.normal(loc=0.95, scale=0.02, size=(10,)), 0, 1),
}
f1_pvals_dict = {
    'method_1 vs method_3': 0.01,
    'method_2 vs method_3': 3e-4,
}

plt.rcParams['font.family'] = 'serif'
plt.rcParams['legend.fontsize'] = 12
fig = plt.figure(figsize=(14, 6))
ax = fig.add_subplot(1, 3, 1)
ax = sbplot(ax=ax, method_list=method_list, data_dict=auroc_data_dict, pvals_dict=auroc_pvals_dict, ymin=0)
ax.set_ylabel('AUROC', fontsize=18)

ax = fig.add_subplot(1, 3, 2)
ax = sbplot(ax=ax, method_list=method_list, data_dict=acc_data_dict, pvals_dict=acc_pvals_dict, ymin=0)
ax.set_ylabel('Accuracy', fontsize=18)

ax = fig.add_subplot(1, 3, 3)
ax = sbplot(ax=ax, method_list=method_list, data_dict=f1_data_dict, pvals_dict=f1_pvals_dict, ymin=0)
ax.set_ylabel('F1 Score', fontsize=18)

fig.tight_layout(pad=1)
fig.savefig('./sbplot_example.png')
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ChenLiu-1996/StatsPlot",
    "name": "statistical-plot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "plotting, plot, statistical plotting, statistical plot",
    "author": "Chen Liu",
    "author_email": "chen.liu.cl2482@yale.edu",
    "download_url": "https://files.pythonhosted.org/packages/32/60/5894186aa321b66a3c38b2aca53d6443dd6d244df37943c9de0183a65bfc/statistical-plot-0.10.tar.gz",
    "platform": null,
    "description": "# Tools for Statistical Plotting\n\n**Chen Liu** @ [Krishnaswamy Lab](https://krishnaswamylab.org/members), Yale University\n\n[![Latest PyPI version](https://img.shields.io/pypi/v/statistical-plot.svg)](https://pypi.org/project/statistical-plot/)\n[![PyPI license](https://img.shields.io/pypi/l/statistical-plot.svg)](https://pypi.python.org/pypi/statistical-plot/)\n[![PyPI download month](https://img.shields.io/pypi/dm/statistical-plot.svg)](https://pypi.python.org/pypi/statistical-plot/)\n[![PyPI download day](https://img.shields.io/pypi/dd/statistical-plot.svg)](https://pypi.python.org/pypi/statistical-plot/)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n\nPlease kindly **Star** [![Github Stars](https://img.shields.io/github/stars/ChenLiu-1996/StatsPlot.svg?style=social&label=Stars)](https://github.com/ChenLiu-1996/StatsPlot/) this repo for better reach if you find it useful.\n\n## Installation\n```\npip install statistical-plot\n```\n\n## Example Plots\n### Statistical Bar Plot\n\n<img src=\"assets/sbplot_example.png\" height=\"300\"/>\n\n\n\n## Usage\n### Statistical Bar Plot\n\n```\nfrom statistical_plot import sbplot\nfig = plt.figure(figsize=(12, 6))\nax = fig.add_subplot(1, 2, 1)\n\nnp.random.seed(1)\n\nmethod_list = ['method_1', 'method_2', 'method_3']\n\nauroc_data_dict = {\n    'method_1': np.clip(np.random.normal(loc=0.92, scale=0.04, size=(10,)), 0, 1),\n    'method_2': np.clip(np.random.normal(loc=0.75, scale=0.03, size=(10,)), 0, 1),\n    'method_3': np.clip(np.random.normal(loc=0.98, scale=0.02, size=(10,)), 0, 1),\n}\nauroc_pvals_dict = {\n    'method_1 vs method_3': 0.01,\n    'method_2 vs method_3': 5e-5,\n}\n\nacc_data_dict = {\n    'method_1': np.clip(np.random.normal(loc=0.89, scale=0.05, size=(10,)), 0, 1),\n    'method_2': np.clip(np.random.normal(loc=0.81, scale=0.04, size=(10,)), 0, 1),\n    'method_3': np.clip(np.random.normal(loc=0.94, scale=0.03, size=(10,)), 0, 1),\n}\nacc_pvals_dict = {\n    'method_1 vs method_3': 0.01,\n    'method_2 vs method_3': 0.001,\n}\n\nf1_data_dict = {\n    'method_1': np.clip(np.random.normal(loc=0.92, scale=0.04, size=(10,)), 0, 1),\n    'method_2': np.clip(np.random.normal(loc=0.87, scale=0.03, size=(10,)), 0, 1),\n    'method_3': np.clip(np.random.normal(loc=0.95, scale=0.02, size=(10,)), 0, 1),\n}\nf1_pvals_dict = {\n    'method_1 vs method_3': 0.01,\n    'method_2 vs method_3': 3e-4,\n}\n\nplt.rcParams['font.family'] = 'serif'\nplt.rcParams['legend.fontsize'] = 12\nfig = plt.figure(figsize=(14, 6))\nax = fig.add_subplot(1, 3, 1)\nax = sbplot(ax=ax, method_list=method_list, data_dict=auroc_data_dict, pvals_dict=auroc_pvals_dict, ymin=0)\nax.set_ylabel('AUROC', fontsize=18)\n\nax = fig.add_subplot(1, 3, 2)\nax = sbplot(ax=ax, method_list=method_list, data_dict=acc_data_dict, pvals_dict=acc_pvals_dict, ymin=0)\nax.set_ylabel('Accuracy', fontsize=18)\n\nax = fig.add_subplot(1, 3, 3)\nax = sbplot(ax=ax, method_list=method_list, data_dict=f1_data_dict, pvals_dict=f1_pvals_dict, ymin=0)\nax.set_ylabel('F1 Score', fontsize=18)\n\nfig.tight_layout(pad=1)\nfig.savefig('./sbplot_example.png')\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Statistical plotting with good aesthetics.",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/ChenLiu-1996/StatsPlot"
    },
    "split_keywords": [
        "plotting",
        " plot",
        " statistical plotting",
        " statistical plot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "832f3395c1dfdcf1e0cace0a28a0dcde78ec5ab105df4c407b2f9b3fcbcef09a",
                "md5": "d052e640f896cd69d9e1916c6be17cd6",
                "sha256": "efba3e8d871211d824d729724c6266c039fc9ea8270bd706378a8dc8dbdf04e5"
            },
            "downloads": -1,
            "filename": "statistical_plot-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d052e640f896cd69d9e1916c6be17cd6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5476,
            "upload_time": "2024-07-26T00:47:41",
            "upload_time_iso_8601": "2024-07-26T00:47:41.962495Z",
            "url": "https://files.pythonhosted.org/packages/83/2f/3395c1dfdcf1e0cace0a28a0dcde78ec5ab105df4c407b2f9b3fcbcef09a/statistical_plot-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "32605894186aa321b66a3c38b2aca53d6443dd6d244df37943c9de0183a65bfc",
                "md5": "edffec03c11095df7dd312b83c37049a",
                "sha256": "a1883b855522f3d7d5e3a3e3e98dfa1f4891a45487f87b2d89ac30d7448a479b"
            },
            "downloads": -1,
            "filename": "statistical-plot-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "edffec03c11095df7dd312b83c37049a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5032,
            "upload_time": "2024-07-26T00:47:44",
            "upload_time_iso_8601": "2024-07-26T00:47:44.617261Z",
            "url": "https://files.pythonhosted.org/packages/32/60/5894186aa321b66a3c38b2aca53d6443dd6d244df37943c9de0183a65bfc/statistical-plot-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 00:47:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ChenLiu-1996",
    "github_project": "StatsPlot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "statistical-plot"
}
        
Elapsed time: 0.94275s