Skip to content

Commit b1095d6

Browse files
authored
Merge pull request #24 from RicardoRyn/dev
Dev
2 parents c553729 + 2ce3284 commit b1095d6

77 files changed

Lines changed: 3845 additions & 2860 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ wheels/
1313
*.bak
1414

1515
# notebooks
16-
notebooks/
17-
18-
# docs
19-
docs/changelog.md
16+
notebooks/figures/*
2017

2118
tests/figures/*
22-
23-
# utils
24-
utils/

README.md

Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,88 @@
1-
# 简介
1+
# plotfig
2+
3+
## 简介
24

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

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

8-
9-
## 项目结构
10+
### 项目结构
1011

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

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

21-
## 文档与示例
21+
### 文档与示例
2222

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

25-
`plotfig` API 设计简洁,参数灵活,适合科研人员和数据分析师快速集成到自己的数据分析流程中。
26-
其模块化架构便于后续功能扩展和自定义开发。
27-
结合 `matplotlib` 支持矢量图或高分辨率位图和交互式 HTML 输出,适合论文发表和学术展示。
28-
29-
# 安装
30-
31-
## 普通安装
25+
## 安装
3226

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

35-
36-
**使用 pip 安装 <small>(推荐)</small>**
29+
### 使用 pip 安装 (推荐)
3730

3831
```bash
3932
pip install plotfig
4033
```
4134

42-
**使用 GitHub 源码安装**
35+
### 使用 GitHub 源码安装
4336

4437
```bash
4538
git clone --depth 1 https://github.com/RicardoRyn/plotfig.git
4639
cd plotfig
4740
pip install .
4841
```
4942

50-
## 依赖要求
43+
### 依赖要求
5144

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

54-
- [matplotlib](https://matplotlib.org/) ≥ 3.10.1
55-
- [mne-connectivity](https://mne.tools/mne-connectivity/stable/index.html) ≥ 0.7.0
56-
- [nibabel](https://nipy.org/nibabel/) ≥ 5.3.2
57-
- [numpy](https://numpy.org/) ≥ 2.2.4
58-
- [pandas](https://pandas.pydata.org/) ≥ 2.2.3
59-
- [plotly](https://plotly.com/) ≥ 6.1.1
60-
- [kaleido](https://github.com/plotly/Kaleido) ≥ 1.0.0
61-
- [scipy](https://scipy.org/) ≥ 1.15.2
62-
- [loguru](https://loguru.readthedocs.io/en/stable/) ≥ 0.7.3
6347
- [surfplot](https://github.com/danjgale/surfplot) 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。
6448

6549
> ⚠️ **指定 `surfplot` 版本**
6650
>
67-
> 由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版:
68-
>
69-
> ```bash
70-
> # 卸载旧版本
71-
> pip uninstall surfplot
51+
> 由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。
7252
>
73-
> # 克隆源码并安装
74-
> git clone --depth 1 https://github.com/danjgale/surfplot.git
75-
> cd surfplot
76-
> pip install .
77-
>
78-
> # 安装完成后,返回上级目录并删除源码文件夹
79-
> cd ..
80-
> rm -rf surfplot
81-
> ```
53+
> 如果您无须绘制 brain_surface 图,可以忽略此步骤。
8254
83-
## 贡献指南
55+
```bash
56+
# 卸载旧版本
57+
pip uninstall surfplot
58+
59+
# 克隆源码并安装
60+
git clone --depth 1 https://github.com/danjgale/surfplot.git
61+
cd surfplot
62+
pip install .
63+
64+
# 安装完成后,返回上级目录并删除源码文件夹
65+
cd ..
66+
rm -rf surfplot
67+
```
8468

85-
如果您希望参与 `plotfig` 的开发,或者想体验尚未正式发布的新功能和最新修复的 bug,可以选择以开发模式安装项目。
69+
## 贡献指南
8670

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

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

9176
```bash
92-
git clone -b dev https://github.com/<your-username>/plotfig.git
77+
git clone -b dev https://github.com/<your-username >/plotfig.git
9378
cd plotfig
9479
pip install -e .
9580
```
9681

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

99-
无论是 Bug 报告、功能建议,还是文档改进,都非常欢迎你的参与。
100-
如果你在使用过程中遇到了问题,或者有更好的想法,欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。
84+
无论是 Bug 报告、功能建议、还是文档改进。
85+
86+
都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。
87+
10188
也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 🙌!

docs/api/index.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,10 @@
1111

1212
::: plotfig.matrix
1313

14-
::: plotfig.circos
15-
1614
::: plotfig.brain_surface
1715

18-
::: plotfig.brain_surface_deprecated
19-
options:
20-
members:
21-
- plot_human_brain_figure
22-
- plot_human_hemi_brain_figure
23-
- plot_chimpanzee_brain_figure
24-
- plot_chimpanzee_hemi_brain_figure
25-
- plot_macaque_brain_figure
26-
- plot_macaque_hemi_brain_figure
16+
::: plotfig.circos
17+
18+
::: plotfig.brain_connection
2719

28-
::: plotfig.brain_connection
20+
::: plotfig.utils

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
自动更新!
4+
Automatically update!

docs/index.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
# 简介
22

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

66
![plotfig](./assets/plotfig.png)
77

8-
98
## 项目结构
109

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

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

21-
## 文档与示例
19+
## 特性
2220

2321
`plotfig` API 设计简洁,参数灵活,适合科研人员和数据分析师快速集成到自己的数据分析流程中。
2422
其模块化架构便于后续功能扩展和自定义开发。
@@ -29,5 +27,4 @@
2927
烫知识:一张图上的所有元素[^1]
3028
![Parts of a Figure](https://matplotlib.org/stable/_images/anatomy.png)
3129

32-
[^1]:
33-
[Quick start guide of matplotlib.](https://matplotlib.org/stable/tutorials/introductory/usage.html#parts-of-a-figure)
30+
[^1]: [Quick start guide of matplotlib.](https://matplotlib.org/stable/tutorials/introductory/usage.html#parts-of-a-figure)

docs/installation.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

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

7-
**使用 pip 安装 <small>(推荐)</small>**
7+
### 使用 pip 安装 (推荐)
88

99
```bash
1010
pip install plotfig
1111
```
1212

13-
**使用 GitHub 源码安装**
13+
### 使用 GitHub 源码安装
1414

1515
```bash
1616
git clone --depth 1 https://github.com/RicardoRyn/plotfig.git
@@ -20,22 +20,15 @@ pip install .
2020

2121
## 依赖要求
2222

23-
`plotfig` 依赖若干核心库,这些依赖将在安装过程中自动处理:
24-
25-
- [matplotlib](https://matplotlib.org/) ≥ 3.10.1
26-
- [mne-connectivity](https://mne.tools/mne-connectivity/stable/index.html) ≥ 0.7.0
27-
- [nibabel](https://nipy.org/nibabel/) ≥ 5.3.2
28-
- [numpy](https://numpy.org/) ≥ 2.2.4
29-
- [pandas](https://pandas.pydata.org/) ≥ 2.2.3
30-
- [plotly](https://plotly.com/) ≥ 6.1.1
31-
- [kaleido](https://github.com/plotly/Kaleido) ≥ 1.0.0
32-
- [scipy](https://scipy.org/) ≥ 1.15.2
33-
- [loguru](https://loguru.readthedocs.io/en/stable/) ≥ 0.7.3
23+
`plotfig` 依赖若干核心库,这些依赖将在安装过程中自动处理,但需要注意:
24+
3425
- [surfplot](https://github.com/danjgale/surfplot) 需使用其 GitHub 仓库中的最新版,而非 PyPI 上的版本,因后者尚未包含所需功能。
3526

3627
!!! warning "指定 `surfplot` 版本"
3728

38-
由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版:
29+
由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。
30+
31+
如果您无须绘制 brain_surface 图,可以忽略此步骤。
3932

4033
```bash
4134
# 卸载旧版本
@@ -53,8 +46,7 @@ pip install .
5346

5447
## 贡献指南
5548

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

6052
推荐先 Fork 仓库,然后克隆您自己的 Fork:
@@ -67,6 +59,8 @@ pip install -e .
6759

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

70-
无论是 Bug 报告、功能建议,还是文档改进,都非常欢迎你的参与。
71-
如果你在使用过程中遇到了问题,或者有更好的想法,欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。
62+
无论是 Bug 报告、功能建议、还是文档改进。
63+
64+
都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。
65+
7266
也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 🙌!

0 commit comments

Comments
 (0)