import matplotlib.pyplot as plt
// Compute the mean EPI: we do the mean along the axis 3, which is time
mean_img = np.mean(fmri_data, axis=3)
// Note that this can also be done on Nifti images using
// nilearn.image.mean_img
// plt.figure() creates a new figure
After Change
import matplotlib.pyplot as plt
// Compute the mean EPI: we do the mean along the axis 3, which is time
mean_haxby = mean_img(haxby_files.func)
plot_epi(mean_haxby)
////// Extracting a brain mask //////////////////////////////////////////////////////////////////////////////////////////////////////