Skip to content

Commit 05467e0

Browse files
committed
docs(readme): refactor README with modern badges, features, examples, and streamlined installation
1 parent 4b72fcc commit 05467e0

1 file changed

Lines changed: 44 additions & 79 deletions

File tree

README.md

Lines changed: 44 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,73 @@
1-
# plotfig
1+
<div align="center">
22

3-
## 简介
3+
# plotfig
44

5-
`plotfig` 是一个专为科学数据可视化设计的 Python 库,
6-
致力于为认知神经科研工作人员提供高效、易用且美观的图形绘制工具。
7-
该项目基于业界主流的可视化库—— `matplotlib``surfplot``plotly`等库开发,
8-
融合了三者的强大功能,能够满足神经科学以及脑连接组学中多种场景下的复杂绘图需求。
5+
[![PyPI version](https://badge.fury.io/py/plotfig.svg)](https://badge.fury.io/py/plotfig)
6+
[![Python version](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
7+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
98

10-
![plotfig](https://github.com/RicardoRyn/plotfig/blob/main/docs/assets/plotfig.png)
9+
一个专为科学数据可视化设计的 Python 库,致力于为认知神经科研工作人员提供高效、易用且美观的图形绘制工具。
1110

12-
### 项目结构
11+
</div>
1312

14-
项目采用模块化设计,核心代码位于 `src/plotfig/` 目录下,包含如下主要功能模块:
13+
## 功能特性
1514

16-
- `bar.py`:条形图绘制,适用于分组数据的对比展示。
17-
- `matrix.py`:通用矩阵可视化,支持多种配色和注释方式。
18-
- `correlation.py`:相关性矩阵可视化,便于分析变量间的相关性分布。
19-
- `circos.py`:弦图可视化,适合平面展示脑区之间的连接关系。
20-
- `brain_surface.py`:脑表面可视化,实现三维脑表面图集结构的绘制。
21-
- `brain_connection.py`:玻璃脑连接可视化,支持复杂的脑网络结构展示。
15+
- 📊 **多种图表类型**:条形图、矩阵、相关性图、弦图、脑表面图、脑连接图
16+
- 🎨 **专业科研风格**:内置多种配色方案,符合学术发表标准
17+
- 🔬 **专为神经科学设计**:支持脑区 atlas、脑网络可视化等特定场景
18+
- 🚀 **简单易用**:简洁的 API,快速上手
2219

23-
### 文档与示例
20+
## 示例展示
2421

25-
`plotfig` 提供了网页文档和使用示例。具体参见[使用教程](https://ricardoryn.github.io/plotfig/)
22+
### 单组条形图
23+
![Single Group Bar](https://github.com/RicardoRyn/plotfig/blob/main/docs/usage/single_group_files/single_group_11_0.png)
2624

27-
## 安装
25+
### 多组条形图
26+
![Multi Groups Bar](https://github.com/RicardoRyn/plotfig/blob/main/docs/usage/multi_groups_files/multi_groups_2_0.png)
2827

29-
`plotfig` 支持通过包管理器安装或直接从源码中安装,要求 Python 3.11 及以上版本。
28+
### 相关性矩阵
29+
![Correlation Matrix](https://github.com/RicardoRyn/plotfig/blob/main/docs/usage/correlation_files/correlation_10_0.png)
3030

31-
### 使用包管理器安装 (推荐)
31+
### 脑连接图
32+
![Brain Connectivity](https://github.com/RicardoRyn/plotfig/blob/main/docs/usage/brain_connectivity_files/output.gif)
3233

33-
=== "uv"
34+
### 脑表面图
35+
![Brain Surface](https://github.com/RicardoRyn/plotfig/blob/main/docs/usage/brain_surface_files/brain_surface_10_0.png)
3436

35-
``` bash
36-
uv add plotfig
37-
```
37+
## 快速开始
3838

39-
=== "pip"
39+
```python
40+
from plotfig import plot_one_group_bar_figure
41+
import matplotlib.pyplot as plt
4042

41-
``` bash
42-
pip install plotfig
43-
```
43+
# 绘制单组条形图
44+
data = [[1.2, 2.3, 3.1], [4.5, 5.6, 6.2]]
45+
plot_one_group_bar_figure(data)
46+
plt.show()
47+
```
4448

45-
### 从源码中安装
49+
## 安装
4650

47-
首先下载源码到某个目录(例如 `/path/to/plotfig`):
51+
`plotfig` 要求 Python 3.11 及以上版本。
4852

53+
**使用 uv 安装:**
4954
```bash
50-
git clone https://github.com/RicardoRyn/plotfig.git /path/to/plotfig
55+
uv add plotfig
5156
```
5257

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 到本地:
79-
58+
**使用 pip 安装:**
8059
```bash
81-
git clone https://github.com/USERNAME/plotfig.git /path/to/plotfig
60+
pip install plotfig
8261
```
8362

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` 应替换为实际的路径。
63+
其他安装方式请参见[详细安装教程](https://ricardoryn.github.io/plotfig/installation/)
9964

100-
---
65+
## 文档
10166

102-
**欢迎提交 Issue 或 PR!**
67+
详细文档和使用示例请访问 [plotfig 文档](https://ricardoryn.github.io/plotfig/)
10368

104-
无论是 Bug 报告、功能建议、还是文档改进。
69+
## 贡献
10570

106-
都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。
71+
欢迎提交 Issue 或 PR!无论是 Bug 报告、功能建议还是文档改进,都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。
10772

108-
也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 💪!
73+
开发贡献流程请参见[贡献指南](https://ricardoryn.github.io/plotfig/)

0 commit comments

Comments
 (0)