Creating Tiled Montage with nilearn

I have started using nilearn and its plotting capabilities to create beautiful images. I have been using plotting.plot_stat_map function, which is working very well for most of my needs. When trying to plot a large number of slices (>7) the images are concatenated from left to right. Ideally, I would like to specify the number of rows and columns where the images should be placed.

At the moment, I am saving each image individually and then creating a montage with ImageMagick. If anyone has any other suggestions I would appreciate.



1 Like

For the moment, it is not available:

EDIT: in this other issue, we find this useful snippet:

# Grid of subplots
fh = plt.figure()
for pi, img in enumerate(iter_img(index_img(maps_img, slice(None, 16)))):
    ax = fh.add_subplot(4, 4, pi + 1)
    plot_stat_map(img, axes=ax, display_mode='z', cut_coords=1)
1 Like