Complete the code to create a figure with a grid layout of 2 rows and 2 columns.
fig, axs = plt.subplots([1], 2)
Using plt.subplots(2, 2) creates a 2x2 grid layout for the dashboard.
Complete the code to set the figure size to 10 inches wide and 8 inches tall.
fig, axs = plt.subplots(2, 2, figsize=([1], 8))
The figsize parameter takes width and height in inches. Here, width is 10.
Fix the error in the code to add a title to the first subplot.
axs[0, 0].[1]('Sales Over Time')
Use set_title method to set the title of a subplot in matplotlib.
Fill both blanks to adjust spacing between subplots and add a main title to the figure.
fig.[1](hspace=0.5) fig.[2]('Dashboard Overview')
set_title on the figure instead of suptitle.tight_layout without parameters.subplots_adjust changes spacing between subplots. suptitle adds a main title to the figure.
Fill all three blanks to create a 3-row, 1-column layout, set figure size, and add a title to the last subplot.
fig, axs = plt.subplots([1], [2], figsize=([3], 12)) axs[2].set_title('Profit Analysis')
We want 3 rows and 1 column, so plt.subplots(3, 1). The figure width is set to 10 inches.