Skip to content
Merged

Dev #41

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ wheels/
# backup
*.bak

# notebooks
.vscode/*
notebooks/figures/*

tests/figures/*
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ rm -rf surfplot
推荐先 Fork 仓库,然后克隆您自己的 Fork 并安装 `dev` 分支:

```bash
git clone -b dev https://github.com/ <your-username >/plotfig.git
git clone -b dev https://github.com/<your-username>/plotfig.git
cd plotfig
pip install -e .
```
Expand All @@ -90,4 +90,4 @@ pip install -e .

都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。

也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 🙌
也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 💪
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pip install .
推荐先 Fork 仓库,然后克隆您自己的 Fork 并安装 `dev` 分支:

```bash
git clone -b dev https://github.com/ <your-username >/plotfig.git
git clone -b dev https://github.com/<your-username>/plotfig.git
cd plotfig
pip install -e .
```
Expand All @@ -68,4 +68,4 @@ pip install -e .

都非常欢迎在 [Issue](https://github.com/RicardoRyn/plotfig/issues) 中提出。

也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 🙌
也可以直接提交 [PR](https://github.com/RicardoRyn/plotfig/pulls),一起变得更强 💪
2 changes: 1 addition & 1 deletion src/plotfig/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _stars(pval, i, y, color, fontsize):
xy=(i, y),
xytext=(j, y),
arrowprops=dict(
edgecolor=line_color, width=0.5, headwidth=0.1, headlength=0.1
color=line_color, width=0.5, headwidth=0.1, headlength=0.1
),
)
_stars(pval, (i + j) / 2, y + star_offset, color, fontsize)
Expand Down
21 changes: 8 additions & 13 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import random
import numpy as np
import matplotlib.pyplot as plt
from plotfig import plot_one_group_bar_figure

input_file = r"e:\git_repositories\plotfig\src\plotfig\data\neurodata\atlases\macaque_D99\label.txt"
output_file = r"e:\git_repositories\plotfig\src\plotfig\data\neurodata\atlases\macaque_D99\label1.txt"
fig, ax = plt.subplots()

with open(input_file, "r", encoding="utf-8") as fin, \
open(output_file, "w", encoding="utf-8") as fout:
data1 = np.random.rand(10)
data2 = np.random.rand(10)

for idx, line in enumerate(fin, start=1):
region_name = line.rstrip("\n")
fout.write(region_name + "\n")
ax = plot_one_group_bar_figure([data1, data2], ax=ax)

r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
# 写格式:序号, r, g, b, 255
fout.write(f"{idx} {r} {g} {b} 255\n")
fig.savefig("test.png")