Skip to main content

Scientific plotting package for Cognitive neuroscience

Project description

plotfig

简介

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

plotfig

项目结构

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

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

文档与示例

plotfig 提供了网页文档和使用示例。具体参见使用教程

安装

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 依赖若干核心库,这些依赖将在安装过程中自动处理,但需要注意:

  • surfplot 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。

⚠️ 指定 surfplot 版本

由于 PyPI 上的 surfplot 版本较旧,缺少 plotfig 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。

如果您无须绘制 brain_surface 图,可以忽略此步骤。

# 卸载旧版本
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:

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

欢迎提交 Issue 或 PR!

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

都非常欢迎在 Issue 中提出。

也可以直接提交 PR,一起变得更强 🙌!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotfig-1.6.0.tar.gz (32.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotfig-1.6.0-py3-none-any.whl (24.3 MB view details)

Uploaded Python 3

File details

Details for the file plotfig-1.6.0.tar.gz.

File metadata

  • Download URL: plotfig-1.6.0.tar.gz
  • Upload date:
  • Size: 32.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plotfig-1.6.0.tar.gz
Algorithm Hash digest
SHA256 2828ba6f10982a0511790e7497f1014f30be8387046622ac7ab4ee4ef6d1ee94
MD5 f6e15c7481065592a793491700d94a09
BLAKE2b-256 b2857ee1a3804cee5d11b8b866879b8313e6e100a05535682d2926e50055fa73

See more details on using hashes here.

Provenance

The following attestation bundles were made for plotfig-1.6.0.tar.gz:

Publisher: python_publish.yml on RicardoRyn/plotfig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plotfig-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: plotfig-1.6.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.13.7

File hashes

Hashes for plotfig-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 679934531dc6520f1e2072d208cc3761c363e3a67aeeaaa438e880926038d1b2
MD5 38ba9adb119c3aab61371e6491587531
BLAKE2b-256 97a4167cfaee700ff860a30aa07d0c6929e248b1a3fd050ac4690bd1b7896071

See more details on using hashes here.

Provenance

The following attestation bundles were made for plotfig-1.6.0-py3-none-any.whl:

Publisher: python_publish.yml on RicardoRyn/plotfig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page