plotfig


Nameplotfig JSON
Version 1.6.1 PyPI version JSON
download
home_pageNone
SummaryScientific plotting package for Cognitive neuroscience
upload_time2025-09-07 06:40:26
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords neuroscience plotting visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # plotfig

## 简介

`plotfig` 是一个专为科学数据可视化设计的 Python 库,致力于为认知神经科研工作人员提供高效、易用且美观的图形绘制工具。
该项目基于业界主流的可视化库—— `matplotlib`、`surfplot` 和 `plotly`等库开发,融合了三者的强大功能,能够满足神经科学、脑连接组学、相关性分析、矩阵可视化等多种科研场景下的复杂绘图需求。

![plotfig](https://github.com/RicardoRyn/plotfig/blob/main/docs/assets/plotfig.png)

### 项目结构

项目采用模块化设计,核心代码位于 `src/plotfig/` 目录下,包含如下主要功能模块:

- `bar.py`:条形图绘制,适用于分组数据的对比展示。
- `correlation.py`:相关性矩阵可视化,便于分析变量间的相关性分布。
- `matrix.py`:通用矩阵可视化,支持多种配色和注释方式。
- `brain_surface.py`:脑表面可视化,实现三维脑表面图集结构的绘制。
- `circos.py`:弦图可视化,适合平面展示脑区之间的连接关系。
- `brain_connection.py`:玻璃脑连接可视化,支持复杂的脑网络结构展示。

### 文档与示例

`plotfig` 提供了网页文档和使用示例。具体参见[使用教程](https://ricardoryn.github.io/plotfig/)。

## 安装

`plotfig` 支持通过 `pip` 或源码安装,要求 Python 3.11 及以上版本。

### 使用 pip 安装 (推荐)

```bash
pip install plotfig
```

### 使用 GitHub 源码安装

```bash
git clone --depth 1 https://github.com/RicardoRyn/plotfig.git
cd plotfig
pip install .
```

### 依赖要求

`plotfig` 依赖若干核心库,这些依赖将在安装过程中自动处理,但需要注意:

- [surfplot](https://github.com/danjgale/surfplot) 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。

> ⚠️ **指定 `surfplot` 版本**
>
> 由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。
>
> 如果您无须绘制 brain_surface 图,可以忽略此步骤。

```bash
# 卸载旧版本
pip uninstall surfplot

# 克隆源码并安装
git clone --depth 1 https://github.com/danjgale/surfplot.git
cd surfplot
pip install .

# 安装完成后,返回上级目录并删除源码文件夹
cd ..
rm -rf surfplot
```

## 贡献指南

如果您希望参与 `plotfig` 的开发,或者想体验尚未正式发布的新功能,可以选择以开发模式安装项目。
这种“可编辑模式(editable mode)”安装方式允许您对本地源码的修改立即生效,非常适合开发、调试和贡献代码。

推荐先 Fork 仓库,然后克隆您自己的 Fork:

```bash
git clone -b dev https://github.com/<your-username >/plotfig.git
cd plotfig
pip install -e .
```

**欢迎提交 Issue 或 PR!**

无论是 Bug 报告、功能建议、还是文档改进。

都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。

也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 🙌!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "plotfig",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "neuroscience, plotting, visualization",
    "author": null,
    "author_email": "Ricardo Ryn <ricardoRyn1317@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c8/a7/7b8cc2352d803f8e82b694d4cac4d811c76085c774569210e81d61e01a1f/plotfig-1.6.1.tar.gz",
    "platform": null,
    "description": "# plotfig\n\n## \u7b80\u4ecb\n\n`plotfig` \u662f\u4e00\u4e2a\u4e13\u4e3a\u79d1\u5b66\u6570\u636e\u53ef\u89c6\u5316\u8bbe\u8ba1\u7684 Python \u5e93\uff0c\u81f4\u529b\u4e8e\u4e3a\u8ba4\u77e5\u795e\u7ecf\u79d1\u7814\u5de5\u4f5c\u4eba\u5458\u63d0\u4f9b\u9ad8\u6548\u3001\u6613\u7528\u4e14\u7f8e\u89c2\u7684\u56fe\u5f62\u7ed8\u5236\u5de5\u5177\u3002\n\u8be5\u9879\u76ee\u57fa\u4e8e\u4e1a\u754c\u4e3b\u6d41\u7684\u53ef\u89c6\u5316\u5e93\u2014\u2014 `matplotlib`\u3001`surfplot` \u548c `plotly`\u7b49\u5e93\u5f00\u53d1\uff0c\u878d\u5408\u4e86\u4e09\u8005\u7684\u5f3a\u5927\u529f\u80fd\uff0c\u80fd\u591f\u6ee1\u8db3\u795e\u7ecf\u79d1\u5b66\u3001\u8111\u8fde\u63a5\u7ec4\u5b66\u3001\u76f8\u5173\u6027\u5206\u6790\u3001\u77e9\u9635\u53ef\u89c6\u5316\u7b49\u591a\u79cd\u79d1\u7814\u573a\u666f\u4e0b\u7684\u590d\u6742\u7ed8\u56fe\u9700\u6c42\u3002\n\n![plotfig](https://github.com/RicardoRyn/plotfig/blob/main/docs/assets/plotfig.png)\n\n### \u9879\u76ee\u7ed3\u6784\n\n\u9879\u76ee\u91c7\u7528\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u6838\u5fc3\u4ee3\u7801\u4f4d\u4e8e `src/plotfig/` \u76ee\u5f55\u4e0b\uff0c\u5305\u542b\u5982\u4e0b\u4e3b\u8981\u529f\u80fd\u6a21\u5757\uff1a\n\n- `bar.py`\uff1a\u6761\u5f62\u56fe\u7ed8\u5236\uff0c\u9002\u7528\u4e8e\u5206\u7ec4\u6570\u636e\u7684\u5bf9\u6bd4\u5c55\u793a\u3002\n- `correlation.py`\uff1a\u76f8\u5173\u6027\u77e9\u9635\u53ef\u89c6\u5316\uff0c\u4fbf\u4e8e\u5206\u6790\u53d8\u91cf\u95f4\u7684\u76f8\u5173\u6027\u5206\u5e03\u3002\n- `matrix.py`\uff1a\u901a\u7528\u77e9\u9635\u53ef\u89c6\u5316\uff0c\u652f\u6301\u591a\u79cd\u914d\u8272\u548c\u6ce8\u91ca\u65b9\u5f0f\u3002\n- `brain_surface.py`\uff1a\u8111\u8868\u9762\u53ef\u89c6\u5316\uff0c\u5b9e\u73b0\u4e09\u7ef4\u8111\u8868\u9762\u56fe\u96c6\u7ed3\u6784\u7684\u7ed8\u5236\u3002\n- `circos.py`\uff1a\u5f26\u56fe\u53ef\u89c6\u5316\uff0c\u9002\u5408\u5e73\u9762\u5c55\u793a\u8111\u533a\u4e4b\u95f4\u7684\u8fde\u63a5\u5173\u7cfb\u3002\n- `brain_connection.py`\uff1a\u73bb\u7483\u8111\u8fde\u63a5\u53ef\u89c6\u5316\uff0c\u652f\u6301\u590d\u6742\u7684\u8111\u7f51\u7edc\u7ed3\u6784\u5c55\u793a\u3002\n\n### \u6587\u6863\u4e0e\u793a\u4f8b\n\n`plotfig` \u63d0\u4f9b\u4e86\u7f51\u9875\u6587\u6863\u548c\u4f7f\u7528\u793a\u4f8b\u3002\u5177\u4f53\u53c2\u89c1[\u4f7f\u7528\u6559\u7a0b](https://ricardoryn.github.io/plotfig/)\u3002\n\n## \u5b89\u88c5\n\n`plotfig` \u652f\u6301\u901a\u8fc7 `pip` \u6216\u6e90\u7801\u5b89\u88c5\uff0c\u8981\u6c42 Python 3.11 \u53ca\u4ee5\u4e0a\u7248\u672c\u3002\n\n### \u4f7f\u7528 pip \u5b89\u88c5 (\u63a8\u8350)\n\n```bash\npip install plotfig\n```\n\n### \u4f7f\u7528 GitHub \u6e90\u7801\u5b89\u88c5\n\n```bash\ngit clone --depth 1 https://github.com/RicardoRyn/plotfig.git\ncd plotfig\npip install .\n```\n\n### \u4f9d\u8d56\u8981\u6c42\n\n`plotfig` \u4f9d\u8d56\u82e5\u5e72\u6838\u5fc3\u5e93\uff0c\u8fd9\u4e9b\u4f9d\u8d56\u5c06\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u81ea\u52a8\u5904\u7406\uff0c\u4f46\u9700\u8981\u6ce8\u610f\uff1a\n\n- [surfplot](https://github.com/danjgale/surfplot) \u9700\u4f7f\u7528\u5176 GitHub \u4ed3\u5e93\u4e2d\u7684\u6700\u65b0\u7248\uff0c\u800c\u975e PyPI \u4e0a\u7684\u7248\u672c\uff0c\u56e0\u540e\u8005\u5c1a\u672a\u5305\u542b\u6240\u9700\u529f\u80fd\u3002\n\n> \u26a0\ufe0f **\u6307\u5b9a `surfplot` \u7248\u672c**\n>\n> \u7531\u4e8e PyPI \u4e0a\u7684 `surfplot` \u7248\u672c\u8f83\u65e7\uff0c\u7f3a\u5c11 `plotfig` \u6240\u9700\u529f\u80fd\uff0c\u5efa\u8bae\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b89\u88c5\u5176 GitHub \u4ed3\u5e93\u7684\u6700\u65b0\u7248\u3002\n>\n> \u5982\u679c\u60a8\u65e0\u987b\u7ed8\u5236 brain_surface \u56fe\uff0c\u53ef\u4ee5\u5ffd\u7565\u6b64\u6b65\u9aa4\u3002\n\n```bash\n# \u5378\u8f7d\u65e7\u7248\u672c\npip uninstall surfplot\n\n# \u514b\u9686\u6e90\u7801\u5e76\u5b89\u88c5\ngit clone --depth 1 https://github.com/danjgale/surfplot.git\ncd surfplot\npip install .\n\n# \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8fd4\u56de\u4e0a\u7ea7\u76ee\u5f55\u5e76\u5220\u9664\u6e90\u7801\u6587\u4ef6\u5939\ncd ..\nrm -rf surfplot\n```\n\n## \u8d21\u732e\u6307\u5357\n\n\u5982\u679c\u60a8\u5e0c\u671b\u53c2\u4e0e `plotfig` \u7684\u5f00\u53d1\uff0c\u6216\u8005\u60f3\u4f53\u9a8c\u5c1a\u672a\u6b63\u5f0f\u53d1\u5e03\u7684\u65b0\u529f\u80fd\uff0c\u53ef\u4ee5\u9009\u62e9\u4ee5\u5f00\u53d1\u6a21\u5f0f\u5b89\u88c5\u9879\u76ee\u3002\n\u8fd9\u79cd\u201c\u53ef\u7f16\u8f91\u6a21\u5f0f\uff08editable mode\uff09\u201d\u5b89\u88c5\u65b9\u5f0f\u5141\u8bb8\u60a8\u5bf9\u672c\u5730\u6e90\u7801\u7684\u4fee\u6539\u7acb\u5373\u751f\u6548\uff0c\u975e\u5e38\u9002\u5408\u5f00\u53d1\u3001\u8c03\u8bd5\u548c\u8d21\u732e\u4ee3\u7801\u3002\n\n\u63a8\u8350\u5148 Fork \u4ed3\u5e93\uff0c\u7136\u540e\u514b\u9686\u60a8\u81ea\u5df1\u7684 Fork\uff1a\n\n```bash\ngit clone -b dev https://github.com/<your-username >/plotfig.git\ncd plotfig\npip install -e .\n```\n\n**\u6b22\u8fce\u63d0\u4ea4 Issue \u6216 PR\uff01**\n\n\u65e0\u8bba\u662f Bug \u62a5\u544a\u3001\u529f\u80fd\u5efa\u8bae\u3001\u8fd8\u662f\u6587\u6863\u6539\u8fdb\u3002\n\n\u90fd\u975e\u5e38\u6b22\u8fce\u5728 [Issue](https://github.com/RicardoRyn/plotfig/issues) \u4e2d\u63d0\u51fa\u3002\n\n\u4e5f\u53ef\u4ee5\u76f4\u63a5\u63d0\u4ea4 [PR](https://github.com/RicardoRyn/plotfig/pulls)\uff0c\u4e00\u8d77\u53d8\u5f97\u66f4\u5f3a \ud83d\ude4c\uff01\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Scientific plotting package for Cognitive neuroscience",
    "version": "1.6.1",
    "project_urls": null,
    "split_keywords": [
        "neuroscience",
        " plotting",
        " visualization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ee426d4cf5277fb8a0785196039ace521361149a763990a97a86e4efa17543d3",
                "md5": "4be57bffef855040fde7fea05545409d",
                "sha256": "7c44adde70499685f64e3d2565439f5cdd45c7ead8752ede3c24d4c11f0da6f1"
            },
            "downloads": -1,
            "filename": "plotfig-1.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4be57bffef855040fde7fea05545409d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 24320128,
            "upload_time": "2025-09-07T06:40:23",
            "upload_time_iso_8601": "2025-09-07T06:40:23.309487Z",
            "url": "https://files.pythonhosted.org/packages/ee/42/6d4cf5277fb8a0785196039ace521361149a763990a97a86e4efa17543d3/plotfig-1.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c8a77b8cc2352d803f8e82b694d4cac4d811c76085c774569210e81d61e01a1f",
                "md5": "a2d7df31d91cbd3589a58cdcdfd96967",
                "sha256": "dec54ed06b1e961d0a92eaf96d1cb0487b79a1422cd5426e0ec3f4e9a99d2755"
            },
            "downloads": -1,
            "filename": "plotfig-1.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a2d7df31d91cbd3589a58cdcdfd96967",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 32662508,
            "upload_time": "2025-09-07T06:40:26",
            "upload_time_iso_8601": "2025-09-07T06:40:26.337039Z",
            "url": "https://files.pythonhosted.org/packages/c8/a7/7b8cc2352d803f8e82b694d4cac4d811c76085c774569210e81d61e01a1f/plotfig-1.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-07 06:40:26",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "plotfig"
}
        
Elapsed time: 1.77153s