Complete the code to import the matplotlib pyplot module.
import matplotlib.[1] as plt
The pyplot module is the standard way to create plots in matplotlib.
Complete the code to set the matplotlib backend to 'Agg' for non-GUI environments.
import matplotlib matplotlib.use('[1]')
The 'Agg' backend is used for writing to files without requiring a display.
Complete the code to correctly switch the backend before importing pyplot.
import matplotlib matplotlib.use('[1]') import matplotlib.pyplot as plt
The backend must be set before importing pyplot. Use 'Agg' for non-GUI environments.
Fill both blanks to set the backend to 'TkAgg' and then import pyplot.
import matplotlib matplotlib.use('[1]') import matplotlib.[2] as plt
First, set the backend to 'TkAgg' for GUI support, then import the 'pyplot' module as plt.
Fill all three blanks to create a plot using the 'Agg' backend and save it to a file.
import matplotlib matplotlib.use('[1]') import matplotlib.[2] as plt plt.plot([1, 2, 3], [4, 5, 6]) plt.[3]('output.png')
Use the 'Agg' backend for file output, import 'pyplot', then use savefig to save the plot as an image file.