Recall & Review
beginner
What is the main purpose of the
pyplot interface in matplotlib?The
pyplot interface provides a simple way to create and customize plots by using functions that work like MATLAB commands. It helps you make graphs step-by-step easily.Click to reveal answer
beginner
Which function in
pyplot is used to create a new figure window?The function
plt.figure() creates a new figure window where you can draw your plots.Click to reveal answer
beginner
How do you add a title to a plot using
pyplot?Use
plt.title('Your Title') to add a title to the current plot.Click to reveal answer
beginner
What does
plt.show() do in the pyplot interface?plt.show() displays all the figures and plots you have created. It opens the plot window so you can see your graph.Click to reveal answer
intermediate
Explain the difference between
plt.plot() and plt.scatter().plt.plot() draws lines connecting points, useful for continuous data. plt.scatter() draws individual points without connecting lines, useful for showing data distribution.Click to reveal answer
Which
pyplot function starts a new plot figure?✗ Incorrect
plt.figure() creates a new figure window for plotting.What does
plt.show() do?✗ Incorrect
plt.show() opens the window to display your plot.Which function adds a title to your plot?
✗ Incorrect
plt.title() sets the title text on the plot.If you want to plot points without connecting lines, which
pyplot function should you use?✗ Incorrect
plt.scatter() plots individual points without lines.What is the typical order of commands to create and display a simple line plot?
✗ Incorrect
First create a figure with
plt.figure(), then plot with plt.plot(), and finally display with plt.show().Describe the basic workflow of creating a plot using the pyplot interface.
Think about the steps from starting a plot to seeing it on screen.
You got /4 concepts.
Explain when you would use plt.plot() versus plt.scatter() in pyplot.
Consider the visual difference between lines and points.
You got /4 concepts.