plotfig 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plotfig-0.3.0/PKG-INFO +60 -0
- plotfig-0.3.0/README.md +41 -0
- plotfig-0.3.0/plotfig.egg-info/PKG-INFO +60 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/pyproject.toml +4 -2
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/__init__.py +14 -2
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/bar.py +92 -140
- plotfig-0.3.0/src/plotfig/brain_connection.py +240 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/brain_surface.py +390 -179
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/circos.py +3 -2
- plotfig-0.3.0/src/plotfig/correlation.py +203 -0
- plotfig-0.3.0/src/plotfig/matrix.py +123 -0
- plotfig-0.2.1/PKG-INFO +0 -62
- plotfig-0.2.1/README.md +0 -43
- plotfig-0.2.1/plotfig.egg-info/PKG-INFO +0 -62
- plotfig-0.2.1/src/plotfig/brain_connection.py +0 -273
- plotfig-0.2.1/src/plotfig/correlation.py +0 -198
- plotfig-0.2.1/src/plotfig/matrix.py +0 -114
- {plotfig-0.2.1 → plotfig-0.3.0}/LICENSE +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/plotfig.egg-info/SOURCES.txt +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/plotfig.egg-info/dependency_links.txt +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/plotfig.egg-info/requires.txt +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/plotfig.egg-info/top_level.txt +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/setup.cfg +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/chimpanzee_bna.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/human_bna.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/human_glasser.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/macaque_bna.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/macaque_charm5.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/macaque_charm5_add_13_sgms.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/macaque_charm6.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/atlas_tables/macaque_d99.csv +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/chimpanzee_BNA/ChimpBNA.L.32k_fs_LR.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/chimpanzee_BNA/ChimpBNA.R.32k_fs_LR.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/human_BNA/fsaverage.L.BNA.32k_fs_LR.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/human_BNA/fsaverage.R.BNA.32k_fs_LR.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/human_Glasser/fsaverage.L.Glasser.32k_fs_LR.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/human_Glasser/fsaverage.R.Glasser.32k_fs_LR.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_BNA/MBNA_124_32k_L.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_BNA/MBNA_124_32k_R.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_CHARM5/L.charm5.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_CHARM5/R.charm5.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_CHARM6/L.charm6.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_CHARM6/R.charm6.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_D99/L.d99.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/atlases/macaque_D99/R.d99.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/chimpanzee_BNA/ChimpYerkes29_v1.2.L.midthickness.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/chimpanzee_BNA/ChimpYerkes29_v1.2.L.veryinflated.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/chimpanzee_BNA/ChimpYerkes29_v1.2.R.midthickness.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/chimpanzee_BNA/ChimpYerkes29_v1.2.R.veryinflated.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/README.md +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_desc-nomedialwall_dparc.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_desc-sulc_midthickness.shape.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_desc-vaavg_midthickness.shape.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_inflated.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_midthickness.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_sphere.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-L_veryinflated.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_desc-nomedialwall_dparc.label.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_desc-sulc_midthickness.shape.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_desc-vaavg_midthickness.shape.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_inflated.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_midthickness.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_sphere.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_den-32k_hemi-R_veryinflated.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_space-fsaverage_den-32k_hemi-L_sphere.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/human_fsLR/tpl-fsLR_space-fsaverage_den-32k_hemi-R_sphere.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.L.inflated.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.L.midthickness.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.L.pial.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.L.veryinflated.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.L.white.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.R.inflated.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.R.midthickness.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.R.pial.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.R.veryinflated.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_BNA/civm.R.white.32k_fs_LR.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/L.gray_surface.inf_300.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/L.gray_surface.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/L.mid_surface.inf_300.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/L.mid_surface.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/L.white_surface.inf_300.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/L.white_surface.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/R.gray_surface.inf_300.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/R.gray_surface.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/R.mid_surface.inf_300.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/R.mid_surface.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/R.white_surface.inf_300.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/surfaces/macaque_NMT2/R.white_surface.surf.gii +0 -0
- {plotfig-0.2.1 → plotfig-0.3.0}/src/plotfig/data/neurodata/volumes/macaque_NMT2/CHARM5_add_13_sgms_asym.nii.gz +0 -0
plotfig-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plotfig
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Scientific plotting package for Cognitive neuroscience
|
|
5
|
+
Author-email: Ricardo Ryn <ricardoRyn1317@gmail.com>
|
|
6
|
+
Keywords: neuroscience,plotting,visualization
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
11
|
+
Requires-Dist: mne-connectivity>=0.7.0
|
|
12
|
+
Requires-Dist: nibabel>=5.3.2
|
|
13
|
+
Requires-Dist: numpy>=2.2.4
|
|
14
|
+
Requires-Dist: pandas>=2.2.3
|
|
15
|
+
Requires-Dist: plotly>=6.0.1
|
|
16
|
+
Requires-Dist: scipy>=1.15.2
|
|
17
|
+
Requires-Dist: surfplot>=0.2.0
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# 简介
|
|
21
|
+
|
|
22
|
+
`plotfig` 是一个面向认知神经科学研究者的 Python 绘图工具包。
|
|
23
|
+
封装了 `matplotlib` 的各种 API,简化了复杂绘图流程。
|
|
24
|
+
可扩展,兼容 `matplotlib` 与 `seaborn`。
|
|
25
|
+
|
|
26
|
+
希望它能让你专注于数据本身而不是琐碎的图形参数调试🥵。
|
|
27
|
+
|
|
28
|
+
[使用教程](https://ricardoryn.github.io/plotfig/)。
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
# 功能
|
|
33
|
+
|
|
34
|
+
画图种类:
|
|
35
|
+
1. 单组柱状/小提琴图
|
|
36
|
+
1. 多组柱状图
|
|
37
|
+
1. 相关图
|
|
38
|
+
1. 矩阵图
|
|
39
|
+
1. 脑区图
|
|
40
|
+
1. 人类Glasser脑区图
|
|
41
|
+
1. 人类BNA脑区图
|
|
42
|
+
1. 猕猴CHARM 5-level脑区图
|
|
43
|
+
1. 猕猴CHARM 6-level脑区图
|
|
44
|
+
1. 猕猴BNA脑区图
|
|
45
|
+
1. 连线图(circos图)
|
|
46
|
+
1. 对称circos图
|
|
47
|
+
1. 不对称circos图
|
|
48
|
+
1. 脑连接图
|
|
49
|
+
|
|
50
|
+
# 叠甲
|
|
51
|
+
|
|
52
|
+
闲来无事做,
|
|
53
|
+
|
|
54
|
+
写堆函数来画图,
|
|
55
|
+
|
|
56
|
+
文档一行无。
|
|
57
|
+
|
|
58
|
+
最自嗨!
|
|
59
|
+
|
|
60
|
+
> 🌟 “调包侠再得一分!”🐶
|
plotfig-0.3.0/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 简介
|
|
2
|
+
|
|
3
|
+
`plotfig` 是一个面向认知神经科学研究者的 Python 绘图工具包。
|
|
4
|
+
封装了 `matplotlib` 的各种 API,简化了复杂绘图流程。
|
|
5
|
+
可扩展,兼容 `matplotlib` 与 `seaborn`。
|
|
6
|
+
|
|
7
|
+
希望它能让你专注于数据本身而不是琐碎的图形参数调试🥵。
|
|
8
|
+
|
|
9
|
+
[使用教程](https://ricardoryn.github.io/plotfig/)。
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
# 功能
|
|
14
|
+
|
|
15
|
+
画图种类:
|
|
16
|
+
1. 单组柱状/小提琴图
|
|
17
|
+
1. 多组柱状图
|
|
18
|
+
1. 相关图
|
|
19
|
+
1. 矩阵图
|
|
20
|
+
1. 脑区图
|
|
21
|
+
1. 人类Glasser脑区图
|
|
22
|
+
1. 人类BNA脑区图
|
|
23
|
+
1. 猕猴CHARM 5-level脑区图
|
|
24
|
+
1. 猕猴CHARM 6-level脑区图
|
|
25
|
+
1. 猕猴BNA脑区图
|
|
26
|
+
1. 连线图(circos图)
|
|
27
|
+
1. 对称circos图
|
|
28
|
+
1. 不对称circos图
|
|
29
|
+
1. 脑连接图
|
|
30
|
+
|
|
31
|
+
# 叠甲
|
|
32
|
+
|
|
33
|
+
闲来无事做,
|
|
34
|
+
|
|
35
|
+
写堆函数来画图,
|
|
36
|
+
|
|
37
|
+
文档一行无。
|
|
38
|
+
|
|
39
|
+
最自嗨!
|
|
40
|
+
|
|
41
|
+
> 🌟 “调包侠再得一分!”🐶
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plotfig
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Scientific plotting package for Cognitive neuroscience
|
|
5
|
+
Author-email: Ricardo Ryn <ricardoRyn1317@gmail.com>
|
|
6
|
+
Keywords: neuroscience,plotting,visualization
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
11
|
+
Requires-Dist: mne-connectivity>=0.7.0
|
|
12
|
+
Requires-Dist: nibabel>=5.3.2
|
|
13
|
+
Requires-Dist: numpy>=2.2.4
|
|
14
|
+
Requires-Dist: pandas>=2.2.3
|
|
15
|
+
Requires-Dist: plotly>=6.0.1
|
|
16
|
+
Requires-Dist: scipy>=1.15.2
|
|
17
|
+
Requires-Dist: surfplot>=0.2.0
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# 简介
|
|
21
|
+
|
|
22
|
+
`plotfig` 是一个面向认知神经科学研究者的 Python 绘图工具包。
|
|
23
|
+
封装了 `matplotlib` 的各种 API,简化了复杂绘图流程。
|
|
24
|
+
可扩展,兼容 `matplotlib` 与 `seaborn`。
|
|
25
|
+
|
|
26
|
+
希望它能让你专注于数据本身而不是琐碎的图形参数调试🥵。
|
|
27
|
+
|
|
28
|
+
[使用教程](https://ricardoryn.github.io/plotfig/)。
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
# 功能
|
|
33
|
+
|
|
34
|
+
画图种类:
|
|
35
|
+
1. 单组柱状/小提琴图
|
|
36
|
+
1. 多组柱状图
|
|
37
|
+
1. 相关图
|
|
38
|
+
1. 矩阵图
|
|
39
|
+
1. 脑区图
|
|
40
|
+
1. 人类Glasser脑区图
|
|
41
|
+
1. 人类BNA脑区图
|
|
42
|
+
1. 猕猴CHARM 5-level脑区图
|
|
43
|
+
1. 猕猴CHARM 6-level脑区图
|
|
44
|
+
1. 猕猴BNA脑区图
|
|
45
|
+
1. 连线图(circos图)
|
|
46
|
+
1. 对称circos图
|
|
47
|
+
1. 不对称circos图
|
|
48
|
+
1. 脑连接图
|
|
49
|
+
|
|
50
|
+
# 叠甲
|
|
51
|
+
|
|
52
|
+
闲来无事做,
|
|
53
|
+
|
|
54
|
+
写堆函数来画图,
|
|
55
|
+
|
|
56
|
+
文档一行无。
|
|
57
|
+
|
|
58
|
+
最自嗨!
|
|
59
|
+
|
|
60
|
+
> 🌟 “调包侠再得一分!”🐶
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "plotfig"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = "Scientific plotting package for Cognitive neuroscience"
|
|
5
5
|
keywords = ["neuroscience", "plotting", "visualization"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -21,7 +21,9 @@ dependencies = [
|
|
|
21
21
|
|
|
22
22
|
[dependency-groups]
|
|
23
23
|
dev = [
|
|
24
|
-
"
|
|
24
|
+
"mkdocs-material>=9.6.14",
|
|
25
|
+
"mkdocs-minify-plugin>=0.8.0",
|
|
26
|
+
"mkdocstrings[python]>=0.29.1",
|
|
25
27
|
]
|
|
26
28
|
|
|
27
29
|
[build-system]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
from .bar import (
|
|
1
|
+
from .bar import (
|
|
2
|
+
plot_one_group_bar_figure,
|
|
3
|
+
plot_one_group_violin_figure,
|
|
4
|
+
plot_multi_group_bar_figure,
|
|
5
|
+
)
|
|
2
6
|
from .correlation import plot_correlation_figure
|
|
3
7
|
from .matrix import plot_matrix_figure
|
|
4
8
|
from .circos import plot_symmetric_circle_figure, plot_asymmetric_circle_figure
|
|
@@ -10,7 +14,9 @@ from .brain_surface import (
|
|
|
10
14
|
plot_chimpanzee_brain_figure,
|
|
11
15
|
plot_chimpanzee_hemi_brain_figure,
|
|
12
16
|
)
|
|
13
|
-
from .brain_connection import plot_brain_connection_figure
|
|
17
|
+
from .brain_connection import plot_brain_connection_figure, save_brain_connection_frames
|
|
18
|
+
|
|
19
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
14
20
|
|
|
15
21
|
__all__ = [
|
|
16
22
|
"plot_one_group_bar_figure",
|
|
@@ -27,4 +33,10 @@ __all__ = [
|
|
|
27
33
|
"plot_symmetric_circle_figure",
|
|
28
34
|
"plot_asymmetric_circle_figure",
|
|
29
35
|
"plot_brain_connection_figure",
|
|
36
|
+
"save_brain_connection_frames"
|
|
30
37
|
]
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
__version__ = version("plotfig")
|
|
41
|
+
except PackageNotFoundError:
|
|
42
|
+
__version__ = "unknown"
|
|
@@ -11,6 +11,12 @@ from scipy import stats
|
|
|
11
11
|
Num = int | float # 可同时接受int和float的类型
|
|
12
12
|
NumArray = list[Num] | npt.NDArray[np.float64] # 数字数组类型
|
|
13
13
|
|
|
14
|
+
__all__ = [
|
|
15
|
+
"plot_one_group_bar_figure",
|
|
16
|
+
"plot_one_group_violin_figure",
|
|
17
|
+
"plot_multi_group_bar_figure",
|
|
18
|
+
]
|
|
19
|
+
|
|
14
20
|
|
|
15
21
|
def compute_summary(data: NumArray) -> tuple[float, float, float]:
|
|
16
22
|
"""计算均值、标准差、标准误"""
|
|
@@ -142,6 +148,7 @@ def plot_one_group_bar_figure(
|
|
|
142
148
|
width: Num = 0.5,
|
|
143
149
|
colors: list[str] | None = None,
|
|
144
150
|
dots_size: Num = 35,
|
|
151
|
+
dots_color: list[list[str]] | None = None,
|
|
145
152
|
title_name: str = "",
|
|
146
153
|
x_label_name: str = "",
|
|
147
154
|
y_label_name: str = "",
|
|
@@ -151,37 +158,29 @@ def plot_one_group_bar_figure(
|
|
|
151
158
|
errorbar_type: str = "se",
|
|
152
159
|
**kwargs: Any,
|
|
153
160
|
) -> None:
|
|
154
|
-
"""
|
|
161
|
+
"""绘制单组柱状图,包含散点和误差条。
|
|
155
162
|
|
|
156
163
|
Args:
|
|
157
|
-
data:
|
|
158
|
-
ax: matplotlib
|
|
159
|
-
labels_name
|
|
160
|
-
width:
|
|
161
|
-
colors
|
|
162
|
-
dots_size:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- x_label_ha: x轴标签水平对齐方式
|
|
176
|
-
- x_tick_fontsize: x轴刻度标签字体大小
|
|
177
|
-
- x_tick_rotation: x轴刻度标签旋转角度
|
|
178
|
-
- y_tick_fontsize: y轴刻度标签字体大小
|
|
179
|
-
- y_tick_rotation: y轴刻度标签旋转角度
|
|
180
|
-
- line_color: 显著性连线颜色
|
|
181
|
-
- asterisk_fontsize: 星号字体大小
|
|
182
|
-
- asterisk_color: 星号颜色
|
|
183
|
-
- 以及其他y轴设置选项(参见set_yaxis函数)
|
|
164
|
+
data (list[NumArray]): 包含多个数据集的列表,每个数据集是一个数字数组。
|
|
165
|
+
ax (Axes | None, optional): matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前的 Axes。
|
|
166
|
+
labels_name (list[str] | None, optional): 每个数据集的标签名称。默认为 None,使用索引作为标签。
|
|
167
|
+
width (Num, optional): 柱子的宽度。默认为 0.5。
|
|
168
|
+
colors (list[str] | None, optional): 每个柱子的颜色。默认为 None,使用灰色。
|
|
169
|
+
dots_size (Num, optional): 散点的大小。默认为 35。
|
|
170
|
+
dots_color (list[list[str]] | None, optional): 每个数据集中散点的颜色。默认为 None,使用灰色。
|
|
171
|
+
title_name (str, optional): 图表的标题。默认为空字符串。
|
|
172
|
+
x_label_name (str, optional): X 轴的标签。默认为空字符串。
|
|
173
|
+
y_label_name (str, optional): Y 轴的标签。默认为空字符串。
|
|
174
|
+
statistic (bool, optional): 是否进行统计检验并标注显著性标记。默认为 False。
|
|
175
|
+
test_method (str, optional): 统计检验的方法,支持 "ttest_ind"、"ttest_rel" 和 "mannwhitneyu"。默认为 "ttest_ind"。
|
|
176
|
+
p_list (list[float] | None, optional): 外部提供的 p 值列表,用于统计检验。默认为 None。
|
|
177
|
+
errorbar_type (str, optional): 误差条类型,支持 "sd"(标准差)和 "se"(标准误)。默认为 "se"。
|
|
178
|
+
**kwargs (Any): 其他可选参数,用于进一步定制图表样式。
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
None
|
|
184
182
|
"""
|
|
183
|
+
|
|
185
184
|
if ax is None:
|
|
186
185
|
ax = plt.gca()
|
|
187
186
|
if labels_name is None:
|
|
@@ -222,7 +221,10 @@ def plot_one_group_bar_figure(
|
|
|
222
221
|
|
|
223
222
|
# 绘制散点
|
|
224
223
|
for i, d in enumerate(data):
|
|
225
|
-
|
|
224
|
+
if dots_color is None:
|
|
225
|
+
add_scatter(ax, scatter_positions[i], d, ["gray"] * len(d), dots_size)
|
|
226
|
+
else:
|
|
227
|
+
add_scatter(ax, scatter_positions[i], d, dots_color[i], dots_size)
|
|
226
228
|
|
|
227
229
|
# 美化
|
|
228
230
|
ax.spines[["top", "right"]].set_visible(False)
|
|
@@ -296,37 +298,30 @@ def plot_one_group_violin_figure(
|
|
|
296
298
|
show_extrema: bool = True,
|
|
297
299
|
**kwargs: Any,
|
|
298
300
|
) -> None:
|
|
299
|
-
"""
|
|
301
|
+
"""绘制单组小提琴图,包含散点和统计显著性标记。
|
|
300
302
|
|
|
301
303
|
Args:
|
|
302
|
-
data:
|
|
303
|
-
ax: matplotlib
|
|
304
|
-
labels_name
|
|
305
|
-
width:
|
|
306
|
-
colors
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
- x_tick_fontsize: x轴刻度标签字体大小
|
|
322
|
-
- x_tick_rotation: x轴刻度标签旋转角度
|
|
323
|
-
- y_tick_fontsize: y轴刻度标签字体大小
|
|
324
|
-
- y_tick_rotation: y轴刻度标签旋转角度
|
|
325
|
-
- line_color: 显著性连线颜色
|
|
326
|
-
- asterisk_fontsize: 星号字体大小
|
|
327
|
-
- asterisk_color: 星号颜色
|
|
328
|
-
- 以及其他y轴设置选项(参见set_yaxis函数)
|
|
304
|
+
data (list[NumArray]): 包含多个数据集的列表,每个数据集是一个数字数组。
|
|
305
|
+
ax (Axes | None, optional): matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前的 Axes。
|
|
306
|
+
labels_name (list[str] | None, optional): 每个数据集的标签名称。默认为 None,使用索引作为标签。
|
|
307
|
+
width (Num, optional): 小提琴图的宽度。默认为 0.8。
|
|
308
|
+
colors (list[str] | None, optional): 每个小提琴图的颜色。默认为 None,使用灰色。
|
|
309
|
+
show_dots (bool, optional): 是否显示散点。默认为 False。
|
|
310
|
+
dots_size (Num, optional): 散点的大小。默认为 35。
|
|
311
|
+
title_name (str, optional): 图表的标题。默认为空字符串。
|
|
312
|
+
x_label_name (str, optional): X 轴的标签。默认为空字符串。
|
|
313
|
+
y_label_name (str, optional): Y 轴的标签。默认为空字符串。
|
|
314
|
+
statistic (bool, optional): 是否进行统计检验并标注显著性标记。默认为 False。
|
|
315
|
+
test_method (str, optional): 统计检验的方法,支持 "ttest_ind"、"ttest_rel" 和 "mannwhitneyu"。默认为 "ttest_ind"。
|
|
316
|
+
p_list (list[float] | None, optional): 外部提供的 p 值列表,用于统计检验。默认为 None。
|
|
317
|
+
show_means (bool, optional): 是否显示均值线。默认为 False。
|
|
318
|
+
show_extrema (bool, optional): 是否显示极值线。默认为 True。
|
|
319
|
+
**kwargs (Any): 其他可选参数,用于进一步定制图表样式。
|
|
320
|
+
|
|
321
|
+
Returns:
|
|
322
|
+
None
|
|
329
323
|
"""
|
|
324
|
+
|
|
330
325
|
ax = ax or plt.gca()
|
|
331
326
|
labels_name = labels_name or [str(i) for i in range(len(data))]
|
|
332
327
|
colors = colors or ["gray"] * len(data)
|
|
@@ -422,43 +417,37 @@ def plot_multi_group_bar_figure(
|
|
|
422
417
|
bar_labels: list[str] | None = None,
|
|
423
418
|
title_name: str = "",
|
|
424
419
|
y_label_name: str = "",
|
|
425
|
-
legend_position: tuple[Num, Num] = (1.2, 1),
|
|
426
420
|
statistic: bool = False,
|
|
427
421
|
test_method: str = "external",
|
|
428
422
|
p_list: list[list[Num]] | None = None,
|
|
429
|
-
legend:
|
|
423
|
+
legend: bool = True,
|
|
424
|
+
legend_position: tuple[Num, Num] = (1.2, 1),
|
|
430
425
|
**kwargs: Any,
|
|
431
426
|
) -> None:
|
|
432
|
-
"""
|
|
427
|
+
"""绘制多组柱状图,包含散点和误差条。
|
|
433
428
|
|
|
434
429
|
Args:
|
|
435
|
-
data:
|
|
436
|
-
ax: matplotlib
|
|
437
|
-
bar_width:
|
|
438
|
-
bar_gap:
|
|
439
|
-
bar_color
|
|
440
|
-
errorbar_type:
|
|
441
|
-
dots_color:
|
|
442
|
-
dots_size:
|
|
443
|
-
group_labels
|
|
444
|
-
bar_labels
|
|
445
|
-
title_name
|
|
446
|
-
y_label_name
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
- y_tick_fontsize: y轴刻度标签字体大小
|
|
457
|
-
- y_tick_rotation: y轴刻度标签旋转角度
|
|
458
|
-
- line_color: 显著性连线颜色
|
|
459
|
-
- asterisk_fontsize: 星号字体大小
|
|
460
|
-
- asterisk_color: 星号颜色
|
|
461
|
-
- 以及其他y轴设置选项(参见set_yaxis函数)
|
|
430
|
+
data (list[list[NumArray]]): 包含多个组的数据,每组是一个数据集列表,每个数据集是一个数字数组。
|
|
431
|
+
ax (plt.Axes | None, optional): matplotlib 的 Axes 对象,用于绘图。默认为 None,使用当前的 Axes。
|
|
432
|
+
bar_width (Num, optional): 每个柱子的宽度。默认为 0.2。
|
|
433
|
+
bar_gap (Num, optional): 柱子之间的间隙。默认为 0.1。
|
|
434
|
+
bar_color (list[str] | None, optional): 每个柱子的颜色。默认为 None,使用灰色。
|
|
435
|
+
errorbar_type (str, optional): 误差条类型,支持 "sd"(标准差)和 "se"(标准误)。默认为 "se"。
|
|
436
|
+
dots_color (str, optional): 散点的颜色。默认为 "gray"。
|
|
437
|
+
dots_size (int, optional): 散点的大小。默认为 35。
|
|
438
|
+
group_labels (list[str] | None, optional): 每组的标签名称。默认为 None,使用 "Group i" 作为标签。
|
|
439
|
+
bar_labels (list[str] | None, optional): 每个柱子的标签名称。默认为 None,使用 "Bar i" 作为标签。
|
|
440
|
+
title_name (str, optional): 图表的标题。默认为空字符串。
|
|
441
|
+
y_label_name (str, optional): Y 轴的标签。默认为空字符串。
|
|
442
|
+
statistic (bool, optional): 是否进行统计检验并标注显著性标记。默认为 False。
|
|
443
|
+
test_method (str, optional): 统计检验的方法,支持 "external"(外部提供 p 值)和其他方法。默认为 "external"。
|
|
444
|
+
p_list (list[list[Num]] | None, optional): 外部提供的 p 值列表,用于统计检验。默认为 None。
|
|
445
|
+
legend (bool, optional): 是否显示图例。默认为 True。
|
|
446
|
+
legend_position (tuple[Num, Num], optional): 图例的位置。默认为 (1.2, 1)。
|
|
447
|
+
**kwargs (Any): 其他可选参数,用于进一步定制图表样式。
|
|
448
|
+
|
|
449
|
+
Returns:
|
|
450
|
+
None
|
|
462
451
|
"""
|
|
463
452
|
|
|
464
453
|
# 动态参数
|
|
@@ -466,7 +455,7 @@ def plot_multi_group_bar_figure(
|
|
|
466
455
|
ax = plt.gca()
|
|
467
456
|
n_groups = len(data)
|
|
468
457
|
if group_labels is None:
|
|
469
|
-
group_labels = [f"Group {i+1}" for i in range(n_groups)]
|
|
458
|
+
group_labels = [f"Group {i + 1}" for i in range(n_groups)]
|
|
470
459
|
# 把所有子列表展开成一个大列表
|
|
471
460
|
all_values = [x for sublist1 in data for sublist2 in sublist1 for x in sublist2]
|
|
472
461
|
|
|
@@ -474,11 +463,16 @@ def plot_multi_group_bar_figure(
|
|
|
474
463
|
for index_group, group_data in enumerate(data):
|
|
475
464
|
n_bars = len(group_data)
|
|
476
465
|
if bar_labels is None:
|
|
477
|
-
bar_labels = [f"Bar {i+1}" for i in range(n_bars)]
|
|
466
|
+
bar_labels = [f"Bar {i + 1}" for i in range(n_bars)]
|
|
478
467
|
if bar_color is None:
|
|
479
468
|
bar_color = ["gray"] * n_bars
|
|
480
469
|
|
|
481
|
-
x_positions =
|
|
470
|
+
x_positions = (
|
|
471
|
+
np.arange(n_bars) * (bar_width + bar_gap)
|
|
472
|
+
+ bar_width / 2
|
|
473
|
+
+ index_group
|
|
474
|
+
- (n_bars * bar_width + (n_bars - 1) * bar_gap) / 2
|
|
475
|
+
)
|
|
482
476
|
x_positions_all.append(x_positions)
|
|
483
477
|
|
|
484
478
|
# 计算均值、标准差、标准误
|
|
@@ -490,7 +484,9 @@ def plot_multi_group_bar_figure(
|
|
|
490
484
|
elif errorbar_type == "se":
|
|
491
485
|
error_values = ses
|
|
492
486
|
# 绘制柱子
|
|
493
|
-
bars = ax.bar(
|
|
487
|
+
bars = ax.bar(
|
|
488
|
+
x_positions, means, width=bar_width, color=bar_color, alpha=1, edgecolor="k"
|
|
489
|
+
)
|
|
494
490
|
ax.errorbar(
|
|
495
491
|
x_positions,
|
|
496
492
|
means,
|
|
@@ -502,7 +498,9 @@ def plot_multi_group_bar_figure(
|
|
|
502
498
|
)
|
|
503
499
|
# 绘制散点
|
|
504
500
|
for index_bar, dot in enumerate(group_data):
|
|
505
|
-
dot_x_pos = np.random.normal(
|
|
501
|
+
dot_x_pos = np.random.normal(
|
|
502
|
+
x_positions[index_bar], scale=bar_width / 7, size=len(dot)
|
|
503
|
+
)
|
|
506
504
|
add_scatter(ax, dot_x_pos, dot, dots_color, dots_size=dots_size)
|
|
507
505
|
if legend:
|
|
508
506
|
ax.legend(bars, bar_labels, bbox_to_anchor=legend_position)
|
|
@@ -517,7 +515,7 @@ def plot_multi_group_bar_figure(
|
|
|
517
515
|
ax.spines[["top", "right"]].set_visible(False)
|
|
518
516
|
ax.set_title(
|
|
519
517
|
title_name,
|
|
520
|
-
fontsize=kwargs.get("title_fontsize",
|
|
518
|
+
fontsize=kwargs.get("title_fontsize", 15),
|
|
521
519
|
pad=kwargs.get("title_pad", 20),
|
|
522
520
|
)
|
|
523
521
|
ax.set_ylabel(y_label_name, fontsize=kwargs.get("y_label_fontsize", 10))
|
|
@@ -550,53 +548,7 @@ def plot_multi_group_bar_figure(
|
|
|
550
548
|
|
|
551
549
|
|
|
552
550
|
def main():
|
|
553
|
-
|
|
554
|
-
from pathlib import Path
|
|
555
|
-
|
|
556
|
-
# 测试数据
|
|
557
|
-
np.random.seed(42)
|
|
558
|
-
data = np.array(
|
|
559
|
-
[
|
|
560
|
-
0.00001 * np.random.normal(0, 1, 100),
|
|
561
|
-
0.00001 * np.random.normal(0, 1, 100),
|
|
562
|
-
0.00001 * np.random.normal(0, 1, 100),
|
|
563
|
-
]
|
|
564
|
-
)
|
|
565
|
-
# 测试函数
|
|
566
|
-
fig, ax = plt.subplots(1, 1, figsize=(3, 3))
|
|
567
|
-
plot_one_group_violin_figure(
|
|
568
|
-
data,
|
|
569
|
-
ax=ax,
|
|
570
|
-
labels_name=["AAA", "BBB", "CCC"],
|
|
571
|
-
width=0.3,
|
|
572
|
-
colors=["red", "blue", "green"],
|
|
573
|
-
show_dots=True,
|
|
574
|
-
dots_size=10,
|
|
575
|
-
title_name="this is a title_name",
|
|
576
|
-
x_label_name="x_label_name",
|
|
577
|
-
y_label_name="y_label_name",
|
|
578
|
-
statistic=True,
|
|
579
|
-
test_method="external",
|
|
580
|
-
p_list=[1, 0.01, 0.001],
|
|
581
|
-
errorbar_type="sd",
|
|
582
|
-
title_fontsize=7,
|
|
583
|
-
title_pad=2,
|
|
584
|
-
x_label_fontsize=7,
|
|
585
|
-
y_label_fontsize=7,
|
|
586
|
-
x_label_ha="right",
|
|
587
|
-
x_tick_fontsize=7,
|
|
588
|
-
x_tick_rotation=30,
|
|
589
|
-
y_tick_fontsize=7,
|
|
590
|
-
y_tick_rotation=30,
|
|
591
|
-
line_color="red",
|
|
592
|
-
asterisk_fontsize=7,
|
|
593
|
-
asterisk_color="red",
|
|
594
|
-
)
|
|
595
|
-
# 测试输出
|
|
596
|
-
save_dir = Path(__file__).parent / "tests_output"
|
|
597
|
-
save_dir.mkdir(exist_ok=True) # 自动创建这个目录(如果没有)
|
|
598
|
-
save_path = save_dir / "test.png"
|
|
599
|
-
fig.savefig(save_path, dpi=300, bbox_inches="tight")
|
|
551
|
+
pass
|
|
600
552
|
|
|
601
553
|
|
|
602
554
|
if __name__ == "__main__":
|