Plotting.plot_glass_brain; size figure

Hi all,

I’m trying to visualize my data. I’m using plotting.plot_glass_brain

My code :

#Print all the images 
image =['average_rmap_CER.nii.gz','average_rmap_DMN.nii.gz','average_rmap_FP.nii.gz','average_rmap_LIM.nii.gz',

for i in image :
b = "/Users/bims1/Documents/projects/connectivity/connectomes/rmap_seeds/" + i
DMN_gen = plotting.plot_glass_brain(b, draw_cross = True, colorbar=True, threshold = 0.3, title = i, cmap = 'viridis')

Can I change the size of my figures ? Their emplacement on my screen ? Now it’s one after the other vertical, but I might want to put them 2 on the same line ?

I looked in to the function plotting.plot_glass_brain and in but I found nothing.

Thanks for your help

You can change the size of each figure by create a figure and passing it to plot_glass_brain as follows:
fig = plt.figure(figsize=(10, 5))
plot_glass_brain(b, figure=fig)

With regards to placement of screen, this is something that is controlled by the environment in which you are running Python, whichever that is. It could be your window manager, or Jupyterlab, or spyder. It is not controlled by nilearn. I don’t know how to control position.

Thanks! It change only my figure, do you think I can also change my colorbar ? I’m getting a way to big colorbar 30%20AM

Thanks again! Yes I’m using Jupiter notebook, I will continue looking to change the placement.

For your colorbar problem, the solution is simply to make the figure less tall.

1 Like