Complete the code to import the matplotlib pyplot module.
import matplotlib.[1] as plt
The pyplot module in matplotlib is used for plotting graphs and provides the toolbar with zoom and pan.
Complete the code to create a figure and axes for plotting.
fig, ax = plt.[1]()plot() returns a line, not figure and axes.figure() returns only the figure, no axes.The subplots() function creates a figure and axes objects, which are needed to plot and use the toolbar.
Fix the error in the code to plot a simple line on the axes.
ax.[1]([1, 2, 3], [4, 5, 6])
draw() which is not a method of axes.show() which displays the figure but does not plot data.The plot() method draws a line on the axes. Other options do not produce the correct line plot.
Fill both blanks to enable the toolbar and display the plot with zoom and pan.
plt.[1]() plt.[2]()
figure() instead of draw() does not refresh the plot.pause() is for animation, not toolbar activation.draw() refreshes the figure to enable interactive features like zoom and pan. show() displays the plot window with the toolbar.
Fill all three blanks to create a plot with zoom and pan enabled and set the title.
fig, ax = plt.[1]() ax.[2]([10, 20, 30], [1, 4, 9]) ax.set_[3]('Zoom and Pan Example')
figure() instead of subplots() misses axes creation.xlabel instead of title sets the x-axis label, not the title.subplots() creates the figure and axes, plot() draws the line, and set_title() sets the plot title.