Skip to content

Commit 35b84a2

Browse files
committed
ENH improve figures
1 parent 2c5e1de commit 35b84a2

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

tutorials/movies_3T/01_plot_explainable_variance.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
performances. The explainable variance is also sometimes called the *noise
1818
ceiling*.
1919
"""
20-
# sphinx_gallery_thumbnail_number = 2
20+
# sphinx_gallery_thumbnail_number = 1
2121
###############################################################################
2222
# Path of the data directory
2323
import os
@@ -63,23 +63,27 @@
6363
import matplotlib.pyplot as plt
6464

6565
voxel_1 = np.argmax(ev)
66-
plt.figure(figsize=(10, 4))
66+
plt.figure(figsize=(10, 3))
6767
plt.plot(Y_test[:, :, voxel_1].T, color='C0', alpha=0.5)
6868
plt.plot(Y_test[:, :, voxel_1].mean(0), color='C1', label='average')
6969
plt.xlabel("Time points")
7070
plt.title("Voxel with large explainable variance (%.2f)" % ev[voxel_1])
71+
plt.yticks([])
7172
plt.legend()
73+
plt.tight_layout()
7274
plt.show()
7375

7476
###############################################################################
7577
# ... and of a voxel with low explainable variance.
7678
voxel_2 = np.argmin(ev)
77-
plt.figure(figsize=(10, 4))
79+
plt.figure(figsize=(10, 3))
7880
plt.plot(Y_test[:, :, voxel_2].T, color='C0', alpha=0.5)
7981
plt.plot(Y_test[:, :, voxel_2].mean(0), color='C1', label='average')
8082
plt.xlabel("Time points")
8183
plt.title("Voxel with low explainable variance (%.2f)" % ev[voxel_2])
84+
plt.yticks([])
8285
plt.legend()
86+
plt.tight_layout()
8387
plt.show()
8488

8589
###############################################################################

tutorials/notebooks/movies_3T/01_plot_explainable_variance.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
},
128128
"outputs": [],
129129
"source": [
130-
"import matplotlib.pyplot as plt\n\nvoxel_1 = np.argmax(ev)\nplt.figure(figsize=(10, 4))\nplt.plot(Y_test[:, :, voxel_1].T, color='C0', alpha=0.5)\nplt.plot(Y_test[:, :, voxel_1].mean(0), color='C1', label='average')\nplt.xlabel(\"Time points\")\nplt.title(\"Voxel with large explainable variance (%.2f)\" % ev[voxel_1])\nplt.legend()\nplt.show()"
130+
"import matplotlib.pyplot as plt\n\nvoxel_1 = np.argmax(ev)\nplt.figure(figsize=(10, 3))\nplt.plot(Y_test[:, :, voxel_1].T, color='C0', alpha=0.5)\nplt.plot(Y_test[:, :, voxel_1].mean(0), color='C1', label='average')\nplt.xlabel(\"Time points\")\nplt.title(\"Voxel with large explainable variance (%.2f)\" % ev[voxel_1])\nplt.yticks([])\nplt.legend()\nplt.tight_layout()\nplt.show()"
131131
]
132132
},
133133
{
@@ -145,7 +145,7 @@
145145
},
146146
"outputs": [],
147147
"source": [
148-
"voxel_2 = np.argmin(ev)\nplt.figure(figsize=(10, 4))\nplt.plot(Y_test[:, :, voxel_2].T, color='C0', alpha=0.5)\nplt.plot(Y_test[:, :, voxel_2].mean(0), color='C1', label='average')\nplt.xlabel(\"Time points\")\nplt.title(\"Voxel with low explainable variance (%.2f)\" % ev[voxel_2])\nplt.legend()\nplt.show()"
148+
"voxel_2 = np.argmin(ev)\nplt.figure(figsize=(10, 3))\nplt.plot(Y_test[:, :, voxel_2].T, color='C0', alpha=0.5)\nplt.plot(Y_test[:, :, voxel_2].mean(0), color='C1', label='average')\nplt.xlabel(\"Time points\")\nplt.title(\"Voxel with low explainable variance (%.2f)\" % ev[voxel_2])\nplt.yticks([])\nplt.legend()\nplt.tight_layout()\nplt.show()"
149149
]
150150
},
151151
{

0 commit comments

Comments
 (0)