|
1 | | -# plotfig |
2 | | - |
3 | | -## 简介 |
4 | | - |
5 | | -`plotfig` 是一个专为科学数据可视化设计的 Python 库, |
6 | | -致力于为认知神经科研工作人员提供高效、易用且美观的图形绘制工具。 |
7 | | -该项目基于业界主流的可视化库—— `matplotlib`、`surfplot` 和 `plotly`等库开发, |
8 | | -融合了三者的强大功能,能够满足神经科学以及脑连接组学中多种场景下的复杂绘图需求。 |
| 1 | +<div align="center"> |
9 | 2 |
|
10 | | - |
11 | | - |
12 | | -### 项目结构 |
| 3 | +# plotfig |
13 | 4 |
|
14 | | -项目采用模块化设计,核心代码位于 `src/plotfig/` 目录下,包含如下主要功能模块: |
| 5 | +[](https://badge.fury.io/py/plotfig) |
| 6 | +[](https://www.python.org/downloads/) |
| 7 | +[](LICENSE) |
15 | 8 |
|
16 | | -- `bar.py`:条形图绘制,适用于分组数据的对比展示。 |
17 | | -- `matrix.py`:通用矩阵可视化,支持多种配色和注释方式。 |
18 | | -- `correlation.py`:相关性矩阵可视化,便于分析变量间的相关性分布。 |
19 | | -- `circos.py`:弦图可视化,适合平面展示脑区之间的连接关系。 |
20 | | -- `brain_surface.py`:脑表面可视化,实现三维脑表面图集结构的绘制。 |
21 | | -- `brain_connection.py`:玻璃脑连接可视化,支持复杂的脑网络结构展示。 |
| 9 | +一个专为认知神经科学研究设计的 Python 可视化库,提供高效、易用且美观的绘图工具。 |
22 | 10 |
|
23 | | -### 文档与示例 |
| 11 | + |
24 | 12 |
|
25 | | -`plotfig` 提供了网页文档和使用示例。具体参见[使用教程](https://ricardoryn.github.io/plotfig/)。 |
| 13 | +</div> |
26 | 14 |
|
27 | | -## 安装 |
| 15 | +## 功能特性 |
28 | 16 |
|
29 | | -`plotfig` 支持通过包管理器安装或直接从源码中安装,要求 Python 3.11 及以上版本。 |
| 17 | +- 📊 **多种图表类型**:条形图、矩阵、相关性图、弦图、脑表面图、脑连接图 |
| 18 | +- 🎨 **专业科研风格**:内置多种配色方案,符合学术发表标准 |
| 19 | +- 📈 **自动显著性检验**:内置多种统计方法,自动绘制显著性标记 |
| 20 | +- 🔬 **专为神经科学设计**:支持常见灵长类脑区 atlas、脑网络可视化等特定场景 |
| 21 | +- 🚀 **简单易用**:简洁的 API,快速上手 |
30 | 22 |
|
31 | | -### 使用包管理器安装 (推荐) |
| 23 | +## 快速开始 |
32 | 24 |
|
33 | | -=== "uv" |
| 25 | +```python |
| 26 | +import matplotlib.pyplot as plt |
34 | 27 |
|
35 | | - ``` bash |
36 | | - uv add plotfig |
37 | | - ``` |
| 28 | +from plotfig import plot_one_group_bar_figure |
38 | 29 |
|
39 | | -=== "pip" |
| 30 | +# 绘制单组条形图 |
| 31 | +data = [[1.2, 2.3, 3.1], [4.5, 5.6, 6.2]] |
| 32 | +plot_one_group_bar_figure(data) |
| 33 | +plt.show() |
| 34 | +``` |
40 | 35 |
|
41 | | - ``` bash |
42 | | - pip install plotfig |
43 | | - ``` |
| 36 | +## 安装 |
44 | 37 |
|
45 | | -### 从源码中安装 |
| 38 | +`plotfig` 要求 Python 3.11 及以上版本。 |
46 | 39 |
|
47 | | -首先下载源码到某个目录(例如 `/path/to/plotfig`): |
| 40 | +**使用 uv 安装:** |
48 | 41 |
|
49 | 42 | ```bash |
50 | | -git clone https://github.com/RicardoRyn/plotfig.git /path/to/plotfig |
| 43 | +uv add plotfig |
51 | 44 | ``` |
52 | 45 |
|
53 | | -然后在您的项目目录中执行: |
54 | | - |
55 | | -=== "uv" |
56 | | - |
57 | | - ``` bash |
58 | | - uv add /path/to/plotfig |
59 | | - ``` |
60 | | - |
61 | | -=== "pip" |
62 | | - |
63 | | - ``` bash |
64 | | - pip install /path/to/plotfig |
65 | | - ``` |
66 | | - |
67 | | -> **注意**:`/path/to/plotfig` 应替换为实际的路径。 |
68 | | -
|
69 | | -### 贡献 |
70 | | - |
71 | | -如果您希望体验这些功能或参与 `plotfig` 的开发,可以选择以 开发模式(editable mode) 安装项目。 |
72 | | - |
73 | | -这种安装方式允许您对本地源码的修改立即生效,非常适合调试、开发和贡献代码。 |
74 | | - |
75 | | -推荐流程: |
76 | | - |
77 | | -1. Fork 本仓库到您的 GitHub 账号 |
78 | | -2. 克隆您的 Fork 到本地: |
| 46 | +**使用 pip 安装:** |
79 | 47 |
|
80 | 48 | ```bash |
81 | | -git clone https://github.com/USERNAME/plotfig.git /path/to/plotfig |
| 49 | +pip install plotfig |
82 | 50 | ``` |
83 | 51 |
|
84 | | -3. 在您的项目目录中以开发模式安装: |
85 | | - |
86 | | -=== "uv" |
87 | | - |
88 | | - ``` bash |
89 | | - uv add --editable /path/to/plotfig |
90 | | - ``` |
91 | | - |
92 | | -=== "pip" |
93 | | - |
94 | | - ``` bash |
95 | | - pip install -e /path/to/plotfig |
96 | | - ``` |
97 | | - |
98 | | -> **注意**:`/path/to/plotfig` 应替换为实际的路径。 |
99 | | -
|
100 | | ---- |
| 52 | +## 文档 |
101 | 53 |
|
102 | | -**欢迎提交 Issue 或 PR!** |
| 54 | +详细文档和使用示例请访问 [plotfig 文档](https://ricardoryn.github.io/plotfig/)。 |
103 | 55 |
|
104 | | -无论是 Bug 报告、功能建议、还是文档改进。 |
| 56 | +## 贡献 |
105 | 57 |
|
106 | | -都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。 |
| 58 | +欢迎提交 Issue 或 PR!无论是 Bug 报告、功能建议还是文档改进,都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。 |
107 | 59 |
|
108 | | -也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 💪! |
| 60 | +开发贡献流程请参见[贡献指南](https://ricardoryn.github.io/plotfig/)。 |
0 commit comments