plt.figure()
for i in range(48):
plt.subplot(6, 8, i + 1)
try:
plt.imshow(plt.imread(file_names[i]), cmap=plt.cm.gray)
except Exception:
// just go to the next one if the file is not present
After Change
file_names = stimulus_information[stim_type]
fig, axes = plt.subplots(6, 8)
fig.suptitle(stim_type)
for img_path, ax in zip(file_names, axes.ravel()):
ax.imshow(plt.imread(img_path), cmap=plt.cm.gray)
for ax in axes.ravel():
ax.axis("off")
show()