You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/examples/plot_colorbar.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,23 +20,27 @@ This example shows how to plot a colorbar besides the brain.
20
20
```{glue:} with_colorbar
21
21
```
22
22
23
+
```{margin} Example data
24
+
The example data is a NumPy array combining masked data of both hemispheres, based on a face-selectivity map from [Jiahui et al. (2020)](https://doi.org/10.1016/j.neuroimage.2019.116458) [Figure 5](https://www.sciencedirect.com/science/article/pii/S1053811919310493#fig5).
25
+
```
23
26
```{code-cell}python
24
27
import numpy as np
25
-
from brainplotlib import brain_plot
28
+
from brainplotlib import brain_plot, example_data
26
29
import matplotlib.pyplot as plt
27
30
28
-
rng = np.random.default_rng(0)
29
-
v = rng.random((1175, ))
31
+
print(example_data.shape, example_data.dtype)
30
32
```
31
33
```{margin} Get color scale information
32
34
The `return_scale` parameter allows returning the color scale information along with the image itself, which can then be used by `plt.colorbar`.
0 commit comments