Complete the code to create a 2x2 subplot grid using matplotlib.
fig, axes = plt.subplots([1], 2)
To create a 2x2 grid, you need 2 rows and 2 columns. The first argument is the number of rows.
Complete the code to display an image on the first subplot.
axes[0, 0].[1](image1)
To display an image in matplotlib, use the imshow method.
Fix the error in the code to remove axis ticks from all subplots.
for ax in axes.flatten(): ax.[1]()
To hide the axis including ticks and labels, use set_axis_off().
Fill both blanks to set the title for the second subplot and adjust layout.
axes[[1]].set_title('Second Image') plt.[2]()
The second subplot in a 2x2 grid is at row 1, column 0 (index [1, 0]). Use tight_layout() to adjust spacing.
Fill all three blanks to create a dictionary of images with their titles, filter images with width > 100, and display them.
images = [1] filtered = {title: img for title, img in images.items() if img.shape[[2]] [3] 100} for ax, (title, img) in zip(axes.flatten(), filtered.items()): ax.imshow(img) ax.set_title(title) plt.tight_layout()
Create a dictionary with image titles as keys. The width is the 1st dimension in img.shape. Filter images where width > 100.