Skip to content

Commit e123fdb

Browse files
committed
Update README and package information.
1 parent 310bdf7 commit e123fdb

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
This is a Python package that plots data on cortical surface.
22

3+
![brain image](https://github.com/feilong/brainplotlib/raw/main/images/random_data_with_colorbar.png)
4+
35
## Installation
46
The package can be installed with pip:
57
```bash
@@ -19,16 +21,18 @@ from brainplotlib import brain_plot
1921
rng = np.random.default_rng(0)
2022
v = rng.random((1175, ))
2123

22-
img = brain_plot(v, vmax=1, vmin=0, cmap='viridis')
24+
img, scale = brain_plot(v, vmax=1, vmin=0, cmap='viridis', return_scale=True)
2325
```
2426

2527
The rendered image is a NumPy array.
2628
It can be rendered using `matplotlib`:
2729
```Python
2830
import matplotlib.pyplot as plt
29-
fig = plt.figure(figsize=(img.shape[1] / 100, img.shape[0] / 100), dpi=100)
31+
fig = plt.figure(figsize=(img.shape[1] / 200, img.shape[0] / 200), dpi=200)
3032
plt.imshow(img)
3133
plt.axis('off')
34+
cbar = plt.colorbar(scale, shrink=0.8, aspect=30)
35+
plt.savefig('random_data_with_colorbar.png', bbox_inches='tight')
3236
plt.show()
3337
```
3438

@@ -39,5 +43,3 @@ cv2.imwrite(
3943
'random_data.png',
4044
np.round(img[:, :, [2, 1, 0]] * 255).astype(np.uint8))
4145
```
42-
43-
![brain image](https://github.com/feilong/brainplotlib/raw/main/images/random_data.png)
498 KB
Loading

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = brainplotlib
3-
version = 0.2.0
3+
version = 0.3.0
44
author = Ma Feilong
55
author_email = mafeilong@gmail.com
66
description = A lightweight package to plot brain surfaces with Python.

0 commit comments

Comments
 (0)