Skip to content

Commit 628a144

Browse files
authored
Merge pull request #38 from RicardoRyn/dev
Dev
2 parents f64ff43 + abb7746 commit 628a144

5 files changed

Lines changed: 33 additions & 22 deletions

File tree

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## 简介
44

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

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

@@ -40,7 +40,7 @@ cd plotfig
4040
pip install .
4141
```
4242

43-
### 依赖要求
43+
## 依赖
4444

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

@@ -50,7 +50,7 @@ pip install .
5050
>
5151
> 由于 PyPI 上的 `surfplot` 版本较旧,缺少 `plotfig` 所需功能,建议通过以下步骤安装其 GitHub 仓库的最新版。
5252
>
53-
> 如果您无须绘制 brain_surface 图,可以忽略此步骤。
53+
> 如果您无须绘制 `brain surface` 图,可以忽略此步骤。
5454
5555
```bash
5656
# 卸载旧版本
@@ -66,19 +66,24 @@ cd ..
6666
rm -rf surfplot
6767
```
6868

69-
## 贡献指南
69+
## 贡献
7070

71-
如果您希望参与 `plotfig` 的开发,或者想体验尚未正式发布的新功能,可以选择以开发模式安装项目。
72-
这种“可编辑模式(editable mode)”安装方式允许您对本地源码的修改立即生效,非常适合开发、调试和贡献代码。
71+
**_`dev` 分支通常包含最新功能以及尚未合并到 `main` 的修复。_**
7372

74-
推荐先 Fork 仓库,然后克隆您自己的 Fork:
73+
如果您希望体验这些功能或参与 `plotfig` 的开发,可以选择以 开发模式(editable mode) 安装项目。
74+
75+
这种安装方式允许您对本地源码的修改立即生效,非常适合调试、开发和贡献代码。
76+
77+
推荐先 Fork 仓库,然后克隆您自己的 Fork 并安装 `dev` 分支:
7578

7679
```bash
77-
git clone -b dev https://github.com/<your-username >/plotfig.git
80+
git clone -b dev https://github.com/ <your-username >/plotfig.git
7881
cd plotfig
7982
pip install -e .
8083
```
8184

85+
---
86+
8287
**欢迎提交 Issue 或 PR!**
8388

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

docs/index.md

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

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

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

88
## 项目结构
99

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

1212
- `bar.py`:条形图绘制,适用于分组数据的对比展示。
1313
- `correlation.py`:相关性矩阵可视化,便于分析变量间的相关性分布。
@@ -18,9 +18,9 @@
1818

1919
## 特性
2020

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

2525
---
2626

docs/installation.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 安装
22

3-
## 普通安装
3+
## 安装方式
44

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

@@ -28,7 +28,7 @@ pip install .
2828

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

31-
如果您无须绘制 brain_surface 图,可以忽略此步骤。
31+
如果您无须绘制 `brain surface` 图,可以忽略此步骤。
3232

3333
```bash
3434
# 卸载旧版本
@@ -46,17 +46,22 @@ pip install .
4646

4747
## 贡献指南
4848

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

52-
推荐先 Fork 仓库,然后克隆您自己的 Fork:
51+
如果您希望体验这些功能或参与 `plotfig` 的开发,可以选择以 开发模式(editable mode) 安装项目。
52+
53+
这种安装方式允许您对本地源码的修改立即生效,非常适合调试、开发和贡献代码。
54+
55+
推荐先 Fork 仓库,然后克隆您自己的 Fork 并安装 `dev` 分支:
5356

5457
```bash
55-
git clone -b dev https://github.com/<your-username>/plotfig.git
58+
git clone -b dev https://github.com/ <your-username >/plotfig.git
5659
cd plotfig
5760
pip install -e .
5861
```
5962

63+
---
64+
6065
**欢迎提交 Issue 或 PR!**
6166

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

src/plotfig/bar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def plot_one_group_bar_figure(
343343
colors_end (list[str] | None, optional):
344344
渐变色的结束颜色列表. Defaults to None.
345345
show_dots (bool, optional):
346-
是否显示散点. Defaults to False.
346+
是否显示散点. Defaults to True.
347347
dots_color (list[list[str]] | None, optional):
348348
散点的颜色列表. Defaults to None.
349349
y_lim (list[Num] | tuple[Num, Num] | None, optional):
@@ -444,7 +444,6 @@ def plot_one_group_bar_figure(
444444
# 创建随机数生成器
445445
rng = np.random.default_rng(seed=42)
446446
scatter_x = rng.normal(i, 0.1, len(d))
447-
print(scatter_x)
448447
scatter_positions.append(scatter_x)
449448
if errorbar_type == "sd":
450449
error_values = sds

src/plotfig/circos.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def plot_circos_figure(
9595
node_colors: list[str] | None = None,
9696
node_space: float = 0.0,
9797
node_label_fontsize: int = 10,
98+
node_label_orientation: Literal["vertical", "horizontal"] = "horizontal",
9899
vmin: float | None = None,
99100
vmax: float | None = None,
100101
cmap: str | None = None,
@@ -114,6 +115,7 @@ def plot_circos_figure(
114115
node_colors (list[str] | None, optional): 脑区颜色列表,长度应与脑区数量一致。默认为None时自动生成颜色
115116
node_space (float, optional): 脑区间间隔角度(度)。默认为0.0
116117
node_label_fontsize (int, optional): 脑区标签字体大小。默认为10
118+
node_label_orientation (Literal["vertical", "horizontal"], optional): 脑区标签方向。默认为"horizontal"
117119
vmin (float | None, optional): 连接强度颜色映射的最小值。默认为None时根据数据自动确定
118120
vmax (float | None, optional): 连接强度颜色映射的最大值。默认为None时根据数据自动确定
119121
cmap (str | None, optional): 颜色映射表名称。默认为None时根据edge_color生成
@@ -190,7 +192,7 @@ def plot_circos_figure(
190192
for sector in circos.sectors:
191193
if sector.name.startswith("_gap"):
192194
continue
193-
sector.text(sector.name, size=node_label_fontsize)
195+
sector.text(sector.name, size=node_label_fontsize, orientation=node_label_orientation)
194196
track = sector.add_track((95, 100))
195197
track.axis(fc=name2color[sector.name])
196198

0 commit comments

Comments
 (0)