Scientific plotting package for Cognitive neuroscience
Project description
简介
plotfig 是一个专为科学数据可视化设计的 Python 库,致力于为认知神经科研工作人员提供高效、易用且美观的图形绘制工具。
该项目基于业界主流的可视化库—— matplotlib、surfplot 和 plotly 开发,融合了三者的强大功能,能够满足神经科学、脑连接组学、相关性分析、矩阵可视化等多种科研场景下的复杂绘图需求。
项目结构
项目采用模块化设计,核心代码位于 src/plotfig/ 目录下,包含如下主要功能模块:
bar.py:条形图绘制,适用于分组数据的对比展示。correlation.py:相关性矩阵可视化,便于分析变量间的相关性分布。matrix.py:通用矩阵可视化,支持多种配色和注释方式。brain_surface.py:脑表面可视化,利用surfplot实现三维脑表面图集结构的绘制。brain_connection.py:玻璃脑连接可视化,支持复杂的脑网络结构展示。circos.py:环状图(Circos)绘制,适合平面展示脑区之间的连接关系。
文档与示例
plotfig 提供了网页文档和使用示例。具体参见使用教程。
plotfig API 设计简洁,参数灵活,适合科研人员和数据分析师快速集成到自己的数据分析流程中。
其模块化架构便于后续功能扩展和自定义开发。
结合 matplotlib 支持矢量图或高分辨率位图和交互式 HTML 输出,适合论文发表和学术展示。
安装
普通安装
plotfig 支持通过 pip 或源码安装,要求 Python 3.11 及以上版本。
使用 pip 安装 (推荐)
pip install plotfig
使用 GitHub 源码安装
git clone --depth 1 https://github.com/RicardoRyn/plotfig.git
cd plotfig
pip install .
贡献指南
如果您希望参与 plotfig 的开发,或者想体验尚未正式发布的新功能和最新修复的 bug,可以选择以开发模式安装项目。
这种“可编辑模式(editable mode)”安装方式允许您对本地源码的修改立即生效,非常适合开发、调试和贡献代码。
推荐先 Fork 仓库,然后克隆您自己的 Fork:
git clone -b dev https://github.com/<your-username>/plotfig.git
cd plotfig
pip install -e .
依赖要求
plotfig 依赖若干核心库,这些依赖将在安装过程中自动处理:
- matplotlib ≥ 3.10.1
- mne-connectivity ≥ 0.7.0
- nibabel ≥ 5.3.2
- numpy ≥ 2.2.4
- pandas ≥ 2.2.3
- plotly ≥ 6.0.1
- scipy ≥ 1.15.2
- surfplot 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。
⚠️ 指定
surfplot版本由于 PyPI 上的
surfplot版本较旧,缺少plotfig所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版:# 卸载旧版本 pip uninstall surfplot # 克隆源码仓库并安装 git clone --depth 1 https://github.com/danjgale/surfplot.git cd surfplot pip install . # 安装完成后,返回上级目录并删除源码文件夹 cd .. rm -rf surfplot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plotfig-1.4.0.tar.gz.
File metadata
- Download URL: plotfig-1.4.0.tar.gz
- Upload date:
- Size: 31.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1e89ae902425c6b53147f673ff2e8defdec4fb52c570669a7bf9e2bf3c6df5b
|
|
| MD5 |
7e572f5d9d6094d7b829dd1a0c3e7bcc
|
|
| BLAKE2b-256 |
637cae0c39190489a384542e69db09cb6ae4587b10fe70b18dcfe950403f327d
|
Provenance
The following attestation bundles were made for plotfig-1.4.0.tar.gz:
Publisher:
python_publish.yml on RicardoRyn/plotfig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plotfig-1.4.0.tar.gz -
Subject digest:
c1e89ae902425c6b53147f673ff2e8defdec4fb52c570669a7bf9e2bf3c6df5b - Sigstore transparency entry: 331524159
- Sigstore integration time:
-
Permalink:
RicardoRyn/plotfig@bb3278b14cf343809d8c070acd8331164058ab5c -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/RicardoRyn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@bb3278b14cf343809d8c070acd8331164058ab5c -
Trigger Event:
release
-
Statement type:
File details
Details for the file plotfig-1.4.0-py3-none-any.whl.
File metadata
- Download URL: plotfig-1.4.0-py3-none-any.whl
- Upload date:
- Size: 24.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11769de5c7a291f6b2409f39d3387faaa84138a5c0621f7d7d508d58307e2f1a
|
|
| MD5 |
8bb2524c06a1b36f0a39c6c729c8c177
|
|
| BLAKE2b-256 |
b67f7c2808c7b36728f97269900cbc51fc26b97e917915947c20e99ca7ec61ef
|
Provenance
The following attestation bundles were made for plotfig-1.4.0-py3-none-any.whl:
Publisher:
python_publish.yml on RicardoRyn/plotfig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plotfig-1.4.0-py3-none-any.whl -
Subject digest:
11769de5c7a291f6b2409f39d3387faaa84138a5c0621f7d7d508d58307e2f1a - Sigstore transparency entry: 331524173
- Sigstore integration time:
-
Permalink:
RicardoRyn/plotfig@bb3278b14cf343809d8c070acd8331164058ab5c -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/RicardoRyn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@bb3278b14cf343809d8c070acd8331164058ab5c -
Trigger Event:
release
-
Statement type: