Skip to content

Commit 215e425

Browse files
committed
dev docs: nilearn/nilearn@1f0c757 : [ENH] make colorbar=True the default for plotting functions (#5172)
1 parent aaf0b16 commit 215e425

File tree

947 files changed

+4931
-4998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

947 files changed

+4931
-4998
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/1020ea2b51f8e38daf607e192d4bdc5d/plot_oasis.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
display = plotting.plot_stat_map(
130130
z_map,
131131
threshold=threshold,
132-
colorbar=True,
133132
display_mode="z",
134133
cut_coords=[-4, 26],
135134
figure=fig,
@@ -148,7 +147,6 @@
148147
plotting.plot_stat_map(
149148
z_map,
150149
threshold=threshold,
151-
colorbar=True,
152150
title="sex effect on gray matter density (FDR = .05)",
153151
)
154152

dev/_downloads/126eff4ec954cc958192cc36d5123433/plot_visualize_megatrawls_netmats.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"outputs": [],
4242
"source": [
43-
"from nilearn.plotting import plot_matrix, show\n\ntitle = \"Partial correlation matrices\\n for d=300\"\ndisplay = plot_matrix(partial_correlation, colorbar=True, title=title)\nshow()"
43+
"from nilearn.plotting import plot_matrix, show\n\ntitle = \"Partial correlation matrices\\n for d=300\"\ndisplay = plot_matrix(partial_correlation, title=title)\nshow()"
4444
]
4545
}
4646
],

dev/_downloads/12cc2d26d59ec4b13cb8816906c03e68/plot_second_level_two_sample_test.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
},
196196
"outputs": [],
197197
"source": [
198-
"plot_glass_brain(\n stat_maps_unpaired[\"effect_variance\"],\n colorbar=True,\n vmin=0,\n vmax=6,\n cmap=\"inferno\",\n title=\"vertical vs horizontal effect variance, unpaired\",\n)\n\nplot_glass_brain(\n stat_maps_paired[\"effect_variance\"],\n colorbar=True,\n vmin=0,\n vmax=6,\n cmap=\"inferno\",\n title=\"vertical vs horizontal effect variance, paired\",\n)\n\nshow()"
198+
"plot_glass_brain(\n stat_maps_unpaired[\"effect_variance\"],\n vmin=0,\n vmax=6,\n cmap=\"inferno\",\n title=\"vertical vs horizontal effect variance, unpaired\",\n)\n\nplot_glass_brain(\n stat_maps_paired[\"effect_variance\"],\n vmin=0,\n vmax=6,\n cmap=\"inferno\",\n title=\"vertical vs horizontal effect variance, paired\",\n)\n\nshow()"
199199
]
200200
},
201201
{
@@ -213,7 +213,7 @@
213213
},
214214
"outputs": [],
215215
"source": [
216-
"threshold = 3.1 # corresponds to p < .001, uncorrected\nplot_glass_brain(\n stat_maps_unpaired[\"z_score\"],\n threshold=threshold,\n colorbar=True,\n plot_abs=False,\n vmax=5.8,\n title=\"vertical vs horizontal (unc p<0.001), unpaired\",\n)\n\nplot_glass_brain(\n stat_maps_paired[\"z_score\"],\n threshold=threshold,\n colorbar=True,\n plot_abs=False,\n vmax=5.8,\n title=\"vertical vs horizontal (unc p<0.001), paired\",\n)\n\nshow()"
216+
"threshold = 3.1 # corresponds to p < .001, uncorrected\nplot_glass_brain(\n stat_maps_unpaired[\"z_score\"],\n threshold=threshold,\n plot_abs=False,\n vmax=5.8,\n title=\"vertical vs horizontal (unc p<0.001), unpaired\",\n)\n\nplot_glass_brain(\n stat_maps_paired[\"z_score\"],\n threshold=threshold,\n plot_abs=False,\n vmax=5.8,\n title=\"vertical vs horizontal (unc p<0.001), paired\",\n)\n\nshow()"
217217
]
218218
},
219219
{

dev/_downloads/193d69e0f7475d4607f305617999a80e/plot_surf_stat_map.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
bg_map=fsaverage_sulcal,
124124
bg_on_data=True,
125125
title="PCC Seed",
126+
colorbar=False,
126127
)
127128

128129
show()
@@ -151,6 +152,7 @@
151152
bg_map=fsaverage_sulcal,
152153
bg_on_data=True,
153154
title="PCC Seed on flat map",
155+
colorbar=False,
154156
)
155157

156158
show()
@@ -205,7 +207,6 @@
205207
stat_map=stat_map_surf,
206208
hemi=hemisphere,
207209
view="medial",
208-
colorbar=True,
209210
bg_map=fsaverage_sulcal,
210211
bg_on_data=True,
211212
darkness=0.3,
@@ -222,7 +223,6 @@
222223
stat_map=stat_map_surf,
223224
hemi=hemisphere,
224225
view="medial",
225-
colorbar=True,
226226
bg_map=fsaverage_sulcal,
227227
bg_on_data=True,
228228
cmap="bwr",
@@ -242,7 +242,6 @@
242242
stat_map=stat_map_surf,
243243
hemi=hemisphere,
244244
view="lateral",
245-
colorbar=True,
246245
cmap="bwr",
247246
threshold=0.5,
248247
title="Plotting without background",
@@ -266,7 +265,6 @@
266265
bg_map=fsaverage_sulcal,
267266
bg_on_data=True,
268267
threshold=0.5,
269-
colorbar=True,
270268
output_file=output_dir / "plot_surf_stat_map.png",
271269
cmap="bwr",
272270
)

dev/_downloads/1c5676eb2c85c27dffcfba93ccaa900c/plot_bids_features.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,13 @@
165165

166166
plot_glass_brain(
167167
z_map,
168-
colorbar=True,
169168
threshold=norm.isf(0.001),
170169
title='Nilearn Z map of "StopSuccess - Go" (unc p<0.001)',
171170
plot_abs=False,
172171
display_mode="ortho",
173172
)
174173
plot_glass_brain(
175174
fsl_z_map,
176-
colorbar=True,
177175
threshold=norm.isf(0.001),
178176
title='FSL Z map of "StopSuccess - Go" (unc p<0.001)',
179177
plot_abs=False,
@@ -204,7 +202,6 @@
204202
plot_contrast_matrix("StopSuccess - Go", design_matrix)
205203
plot_glass_brain(
206204
z_map,
207-
colorbar=True,
208205
threshold=norm.isf(0.001),
209206
plot_abs=False,
210207
display_mode="z",

dev/_downloads/2002f5d0c70b1223f14a1b2bac383088/plot_extract_regions_dictlearning_maps.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
components_img,
6868
view_type="filled_contours",
6969
title="Dictionary Learning maps",
70+
draw_cross=False,
7071
)
7172

7273
show()
@@ -107,7 +108,10 @@
107108
"Each separate color of region indicates extracted region"
108109
)
109110
plot_prob_atlas(
110-
regions_extracted_img, view_type="filled_contours", title=title
111+
regions_extracted_img,
112+
view_type="filled_contours",
113+
title=title,
114+
draw_cross=False,
111115
)
112116

113117
show()
@@ -164,7 +168,7 @@
164168
title = f"Correlation between {int(n_regions_extracted)} regions"
165169

166170
# First plot the matrix
167-
plot_matrix(mean_correlations, vmax=1, vmin=-1, colorbar=True, title=title)
171+
plot_matrix(mean_correlations, vmax=1, vmin=-1, title=title)
168172

169173
# Then find the center of the regions and plot a connectome
170174
regions_img = regions_extracted_img
@@ -190,7 +194,6 @@
190194
plot_stat_map(
191195
img,
192196
cut_coords=coords,
193-
colorbar=True,
194197
title="Showing one specific network",
195198
)
196199

@@ -208,7 +211,9 @@
208211

209212
regions_indices_of_map3 = np.where(np.array(regions_index) == 4)
210213

211-
display = plot_anat(cut_coords=coords, title="Regions from this network")
214+
display = plot_anat(
215+
cut_coords=coords, title="Regions from this network", colorbar=False
216+
)
212217

213218
# Add as an overlay all the regions of index 4
214219
colors = "rgbcmyk"

dev/_downloads/22639334ce8d30070c745bfc1e0d1bc8/plot_second_level_association_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
plot_stat_map(
8484
z_map,
8585
threshold=threshold,
86-
colorbar=True,
8786
title="Group-level association between motor activity \n"
8887
"and reading fluency (fdr=0.05)",
8988
cut_coords=cut_coords,
@@ -119,7 +118,6 @@
119118
)
120119
plot_stat_map(
121120
neg_log_pval,
122-
colorbar=True,
123121
cut_coords=cut_coords,
124122
threshold=threshold,
125123
title=title,
@@ -153,7 +151,6 @@
153151
)
154152
plot_stat_map(
155153
neg_log_pvals_permuted_ols_unmasked,
156-
colorbar=True,
157154
cut_coords=cut_coords,
158155
threshold=threshold,
159156
title=title,
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/2b5d485614d16f2dd7cc6203f2cdb7f9/plot_second_level_association_test.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
},
167167
"outputs": [],
168168
"source": [
169-
"from nilearn.plotting import plot_stat_map, show\n\ncut_coords = [10, -5, 10]\n\nplot_stat_map(\n z_map,\n threshold=threshold,\n colorbar=True,\n title=\"Group-level association between motor activity \\n\"\n \"and reading fluency (fdr=0.05)\",\n cut_coords=cut_coords,\n draw_cross=False,\n)\n\nshow()"
169+
"from nilearn.plotting import plot_stat_map, show\n\ncut_coords = [10, -5, 10]\n\nplot_stat_map(\n z_map,\n threshold=threshold,\n title=\"Group-level association between motor activity \\n\"\n \"and reading fluency (fdr=0.05)\",\n cut_coords=cut_coords,\n draw_cross=False,\n)\n\nshow()"
170170
]
171171
},
172172
{
@@ -202,7 +202,7 @@
202202
},
203203
"outputs": [],
204204
"source": [
205-
"# Since we are plotting negative log p-values and using a threshold equal to 1,\n# it corresponds to corrected p-values lower than 10%, meaning that there\n# is less than 10% probability to make a single false discovery\n# (90% chance that we make no false discoveries at all).\n# This threshold is much more conservative than the previous one.\nthreshold = 1\ntitle = (\n \"Group-level association between motor activity and reading: \\n\"\n \"neg-log of parametric corrected p-values (FWER < 10%)\"\n)\nplot_stat_map(\n neg_log_pval,\n colorbar=True,\n cut_coords=cut_coords,\n threshold=threshold,\n title=title,\n vmin=threshold,\n cmap=\"inferno\",\n draw_cross=False,\n)\nshow()"
205+
"# Since we are plotting negative log p-values and using a threshold equal to 1,\n# it corresponds to corrected p-values lower than 10%, meaning that there\n# is less than 10% probability to make a single false discovery\n# (90% chance that we make no false discoveries at all).\n# This threshold is much more conservative than the previous one.\nthreshold = 1\ntitle = (\n \"Group-level association between motor activity and reading: \\n\"\n \"neg-log of parametric corrected p-values (FWER < 10%)\"\n)\nplot_stat_map(\n neg_log_pval,\n cut_coords=cut_coords,\n threshold=threshold,\n title=title,\n vmin=threshold,\n cmap=\"inferno\",\n draw_cross=False,\n)\nshow()"
206206
]
207207
},
208208
{
@@ -238,7 +238,7 @@
238238
},
239239
"outputs": [],
240240
"source": [
241-
"title = (\n \"Group-level association between motor activity and reading: \\n\"\n \"neg-log of non-parametric corrected p-values (FWER < 10%)\"\n)\nplot_stat_map(\n neg_log_pvals_permuted_ols_unmasked,\n colorbar=True,\n cut_coords=cut_coords,\n threshold=threshold,\n title=title,\n vmin=threshold,\n cmap=\"inferno\",\n draw_cross=False,\n)\nshow()\n\n# The neg-log p-values obtained with non parametric testing are capped at 3\n# since the number of permutations is 1e3.\n# The non parametric test yields a few more discoveries\n# and is then more powerful than the usual parametric procedure."
241+
"title = (\n \"Group-level association between motor activity and reading: \\n\"\n \"neg-log of non-parametric corrected p-values (FWER < 10%)\"\n)\nplot_stat_map(\n neg_log_pvals_permuted_ols_unmasked,\n cut_coords=cut_coords,\n threshold=threshold,\n title=title,\n vmin=threshold,\n cmap=\"inferno\",\n draw_cross=False,\n)\nshow()\n\n# The neg-log p-values obtained with non parametric testing are capped at 3\n# since the number of permutations is 1e3.\n# The non parametric test yields a few more discoveries\n# and is then more powerful than the usual parametric procedure."
242242
]
243243
}
244244
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/3597ffc7be60fdef7ae16aaad5f2a265/plot_surf_atlas.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
},
120120
"outputs": [],
121121
"source": [
122-
"from nilearn.plotting import view_surf\n\nview = view_surf(\n surf_mesh=fsaverage_meshes[\"inflated\"],\n surf_map=destrieux_atlas,\n cmap=\"gist_ncar\",\n symmetric_cmap=False,\n colorbar=False,\n)\n# In a Jupyter notebook, if ``view`` is the output of a cell,\n# it will be displayed below the cell\nview\n\n# uncomment this to open the plot in a web browser:\n# view.open_in_browser()"
122+
"from nilearn.plotting import view_surf\n\nview = view_surf(\n surf_mesh=fsaverage_meshes[\"inflated\"],\n surf_map=destrieux_atlas,\n cmap=\"gist_ncar\",\n symmetric_cmap=False,\n)\n# In a Jupyter notebook, if ``view`` is the output of a cell,\n# it will be displayed below the cell\nview\n\n# uncomment this to open the plot in a web browser:\n# view.open_in_browser()"
123123
]
124124
},
125125
{
@@ -137,7 +137,7 @@
137137
},
138138
"outputs": [],
139139
"source": [
140-
"view = view_connectome(\n corr,\n coordinates,\n edge_threshold=\"90%\",\n colorbar=False,\n)\n\n# uncomment this to open the plot in a web browser:\n# view.open_in_browser()\nview"
140+
"view = view_connectome(\n corr,\n coordinates,\n edge_threshold=\"90%\",\n)\n\n# uncomment this to open the plot in a web browser:\n# view.open_in_browser()\nview"
141141
]
142142
},
143143
{
Binary file not shown.
Binary file not shown.

dev/_downloads/3872fa66ed1a1aa26a7d894ad8d9822f/plot_second_level_two_sample_test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
# But the variance in the unpaired image is larger.
142142
plot_glass_brain(
143143
stat_maps_unpaired["effect_variance"],
144-
colorbar=True,
145144
vmin=0,
146145
vmax=6,
147146
cmap="inferno",
@@ -150,7 +149,6 @@
150149

151150
plot_glass_brain(
152151
stat_maps_paired["effect_variance"],
153-
colorbar=True,
154152
vmin=0,
155153
vmax=6,
156154
cmap="inferno",
@@ -166,7 +164,6 @@
166164
plot_glass_brain(
167165
stat_maps_unpaired["z_score"],
168166
threshold=threshold,
169-
colorbar=True,
170167
plot_abs=False,
171168
vmax=5.8,
172169
title="vertical vs horizontal (unc p<0.001), unpaired",
@@ -175,7 +172,6 @@
175172
plot_glass_brain(
176173
stat_maps_paired["z_score"],
177174
threshold=threshold,
178-
colorbar=True,
179175
plot_abs=False,
180176
vmax=5.8,
181177
title="vertical vs horizontal (unc p<0.001), paired",
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/432c8b6d7f95b7a48cce237073c3045e/plot_3d_map_to_surface_projection.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
surf_mesh=fsaverage_meshes["inflated"],
7171
hemi=hemi,
7272
title="Surface with matplotlib",
73-
colorbar=True,
7473
threshold=1.0,
7574
bg_map=curv_sign,
7675
)
@@ -96,7 +95,6 @@
9695
surf_mesh=fsaverage_meshes["inflated"],
9796
hemi=hemi,
9897
title=f"Surface with {engine}",
99-
colorbar=True,
10098
threshold=1.0,
10199
bg_map=curv_sign,
102100
bg_on_data=True,
@@ -183,7 +181,6 @@
183181
surf_mesh=fsaverage_meshes["inflated"],
184182
hemi=hemi,
185183
title="ROI outlines on surface",
186-
colorbar=True,
187184
threshold=1.0,
188185
bg_map=fsaverage_sulcal,
189186
engine=engine,
@@ -240,7 +237,6 @@
240237
stat_map=big_img,
241238
surf_mesh=big_fsaverage_meshes["inflated"],
242239
hemi=hemi,
243-
colorbar=True,
244240
title="Surface fine mesh",
245241
threshold=1.0,
246242
bg_map=big_fsaverage_sulcal,
@@ -264,7 +260,6 @@
264260
stat_map=stat_img,
265261
views=["lateral", "medial"],
266262
hemispheres=["left", "right"],
267-
colorbar=True,
268263
title="multiple views of the 3D volume",
269264
bg_on_data=True,
270265
)
Binary file not shown.
Binary file not shown.

dev/_downloads/4bb4f5d3d978c5c5149e5b4d5078d2b9/plot_surface_image_and_maskers.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"cell_type": "markdown",
4141
"metadata": {},
4242
"source": [
43-
"let's create a figure with all the views for both hemispheres\n\n"
43+
"let's create a figure with several views for both hemispheres\n\n"
4444
]
4545
},
4646
{
@@ -51,7 +51,7 @@
5151
},
5252
"outputs": [],
5353
"source": [
54-
"views = [\n \"lateral\",\n \"medial\",\n \"dorsal\",\n \"ventral\",\n \"anterior\",\n \"posterior\",\n]\nhemispheres = [\"left\", \"right\", \"both\"]"
54+
"views = [\n \"lateral\",\n \"dorsal\",\n]\nhemispheres = [\"left\", \"right\", \"both\"]"
5555
]
5656
},
5757
{
@@ -87,7 +87,7 @@
8787
},
8888
"outputs": [],
8989
"source": [
90-
"vmax = max(np.absolute(hemi).max() for hemi in mean_img.data.parts.values())\nvmin = -vmax\n\nfor view, ax_row in zip(views, axes):\n for ax, hemi in zip(ax_row, hemispheres):\n if hemi == \"both\" and view == \"lateral\":\n view = \"left\"\n elif hemi == \"both\" and view == \"medial\":\n view = \"right\"\n plot_surf(\n surf_map=mean_img,\n hemi=hemi,\n view=view,\n figure=fig,\n axes=ax,\n title=f\"mean image - {hemi} - {view}\",\n colorbar=False,\n symmetric_cmap=True,\n bg_on_data=True,\n vmin=vmin,\n vmax=vmax,\n bg_map=fsaverage_sulcal,\n cmap=\"seismic\",\n )\nfig.set_size_inches(12, 8)\n\nshow()"
90+
"vmax = max(np.absolute(hemi).max() for hemi in mean_img.data.parts.values())\nvmin = -vmax\n\nfor view, ax_row in zip(views, axes):\n for ax, hemi in zip(ax_row, hemispheres):\n if hemi == \"both\" and view == \"lateral\":\n view = \"left\"\n elif hemi == \"both\" and view == \"medial\":\n view = \"right\"\n plot_surf(\n surf_map=mean_img,\n hemi=hemi,\n view=view,\n figure=fig,\n axes=ax,\n title=f\"{hemi} - {view}\",\n colorbar=False,\n symmetric_cmap=True,\n bg_on_data=True,\n vmin=vmin,\n vmax=vmax,\n bg_map=fsaverage_sulcal,\n cmap=\"seismic\",\n )\nfig.set_size_inches(12, 8)\n\nshow()"
9191
]
9292
},
9393
{
@@ -177,7 +177,7 @@
177177
},
178178
"outputs": [],
179179
"source": [
180-
"from nilearn.decoding import Decoder\n\n# create some random labels\nrng = np.random.RandomState(0)\nn_time_points = surf_img_nki.shape[1]\ny = rng.choice(\n [0, 1],\n replace=True,\n size=n_time_points,\n)\n\ndecoder = Decoder(\n mask=SurfaceMasker(),\n param_grid={\"C\": [0.01, 0.1]},\n cv=3,\n screening_percentile=1,\n)\ndecoder.fit(surf_img_nki, y)\nprint(\"CV scores:\", decoder.cv_scores_)\n\nplot_surf(\n surf_map=decoder.coef_img_[0],\n threshold=1e-6,\n bg_map=fsaverage_sulcal,\n bg_on_data=True,\n colorbar=True,\n cmap=\"inferno\",\n vmin=0,\n)\nshow()"
180+
"from nilearn.decoding import Decoder\n\n# create some random labels\nrng = np.random.RandomState(0)\nn_time_points = surf_img_nki.shape[1]\ny = rng.choice(\n [0, 1],\n replace=True,\n size=n_time_points,\n)\n\ndecoder = Decoder(\n mask=SurfaceMasker(),\n param_grid={\"C\": [0.01, 0.1]},\n cv=3,\n screening_percentile=1,\n)\ndecoder.fit(surf_img_nki, y)\nprint(\"CV scores:\", decoder.cv_scores_)\n\nplot_surf(\n surf_map=decoder.coef_img_[0],\n threshold=1e-6,\n bg_map=fsaverage_sulcal,\n bg_on_data=True,\n cmap=\"inferno\",\n vmin=0,\n)\nshow()"
181181
]
182182
},
183183
{
@@ -195,7 +195,7 @@
195195
},
196196
"outputs": [],
197197
"source": [
198-
"from sklearn import feature_selection, linear_model, pipeline, preprocessing\n\ndecoder = pipeline.make_pipeline(\n SurfaceMasker(),\n preprocessing.StandardScaler(),\n feature_selection.SelectKBest(\n score_func=feature_selection.f_regression, k=500\n ),\n linear_model.Ridge(),\n)\ndecoder.fit(surf_img_nki, y)\n\ncoef_img = decoder[:-1].inverse_transform(np.atleast_2d(decoder[-1].coef_))\n\nvmax = max(np.absolute(hemi).max() for hemi in coef_img.data.parts.values())\nvmin = -vmax\nplot_surf(\n surf_map=coef_img,\n cmap=\"RdBu_r\",\n vmin=vmin,\n vmax=vmax,\n threshold=1e-6,\n bg_map=fsaverage_sulcal,\n bg_on_data=True,\n colorbar=True,\n)\nshow()"
198+
"from sklearn import feature_selection, linear_model, pipeline, preprocessing\n\ndecoder = pipeline.make_pipeline(\n SurfaceMasker(),\n preprocessing.StandardScaler(),\n feature_selection.SelectKBest(\n score_func=feature_selection.f_regression, k=500\n ),\n linear_model.Ridge(),\n)\ndecoder.fit(surf_img_nki, y)\n\ncoef_img = decoder[:-1].inverse_transform(np.atleast_2d(decoder[-1].coef_))\n\nvmax = max(np.absolute(hemi).max() for hemi in coef_img.data.parts.values())\nvmin = -vmax\nplot_surf(\n surf_map=coef_img,\n cmap=\"RdBu_r\",\n vmin=vmin,\n vmax=vmax,\n threshold=1e-6,\n bg_map=fsaverage_sulcal,\n bg_on_data=True,\n)\nshow()"
199199
]
200200
}
201201
],

dev/_downloads/4cd508373a97055a60aae5a827f6de4f/plot_visualization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from nilearn.plotting import plot_epi, show
3434

35-
plot_epi(mean_haxby, colorbar=True, cbar_tick_format="%i")
35+
plot_epi(mean_haxby, cbar_tick_format="%i")
3636

3737
# %%
3838
# Extracting a brain mask
@@ -45,7 +45,7 @@
4545
# Visualize it as an ROI
4646
from nilearn.plotting import plot_roi
4747

48-
plot_roi(mask_img, mean_haxby)
48+
plot_roi(mask_img, mean_haxby, colorbar=False)
4949

5050
# %%
5151
# Applying the mask to extract the corresponding time series
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/517548d0b95c77dfbe4ba2cf6ee8b9dc/plot_second_level_one_sample_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
display = plotting.plot_glass_brain(
106106
z_map,
107107
threshold=p001_unc,
108-
colorbar=True,
109108
display_mode="z",
110109
plot_abs=False,
111110
title="group left-right button press (unc p<0.001)",
@@ -212,7 +211,6 @@
212211
ax = axes[i_row, j_col]
213212
plotting.plot_glass_brain(
214213
IMAGES[img_counter],
215-
colorbar=True,
216214
vmax=vmax,
217215
vmin=threshold,
218216
display_mode="z",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)