Hi,
I was wondering if it is possible to have multi-subjects plots using the nilearn.plotting functions.
Specifically, I want to create an image that allow me to quickly check the alignment of some labels to the structural MRI of a subject.
I can of course do the following
This looks like a job for subplots! Here is a minimal example that should give you inspiration to do what you want:
from nilearn import plotting
from nilearn import datasets
import matplotlib.pyplot as plt
# download some example data
haxby_dataset = datasets.fetch_haxby()
# create a figure with multiple axes to plot each anatomical image
fig, axes = plt.subplots(nrows=5, ncols=2, figsize=(14, 20))
# axes is a 2 dimensional numpy array
for ax in axes.flatten():
display = plotting.plot_anat(haxby_dataset.anat[0], axes=ax)
# save the output figure with all the anatomical images
fig.savefig("my_test_img.png")
Let me know if you have additional questions, or if anyone else has another solution.
James
For the record, I find it much easier to piece figures together after saving them, than with matplotlib. I use typically either an HTML page, or a PDF (generated with LaTeX or restructured text and rst2pdf).