Recall & Review
beginner
What is Matplotlib used for in data science?
Matplotlib is a tool to create pictures from data. It helps us see patterns and understand numbers by drawing charts and graphs.
Click to reveal answer
beginner
How do you create a simple line chart using Matplotlib?
You use the
plot() function to draw lines. For example, plt.plot([1, 2, 3], [4, 5, 6]) draws a line connecting points (1,4), (2,5), and (3,6).Click to reveal answer
beginner
What does
plt.show() do in Matplotlib?It opens a window to display the chart you made. Without
plt.show(), the picture might not appear.Click to reveal answer
beginner
How can you add a title and labels to your Matplotlib chart?
Use
plt.title('Title') for the chart title, plt.xlabel('X label') for the x-axis, and plt.ylabel('Y label') for the y-axis.Click to reveal answer
beginner
What is the difference between
plt.plot() and plt.bar()?plt.plot() draws lines connecting points, good for trends. plt.bar() draws bars, good for comparing amounts.Click to reveal answer
Which Matplotlib function is used to display the final plot?
✗ Incorrect
plt.show() opens the window to show the plot. Other functions prepare or draw but do not display.
What type of chart does
plt.bar() create?✗ Incorrect
plt.bar() creates bar charts to compare values with bars.
How do you add a label to the x-axis in Matplotlib?
✗ Incorrect
plt.xlabel() sets the label for the x-axis.
Which command draws a line connecting points (1,2), (2,3), and (3,4)?
✗ Incorrect
plt.plot() draws lines connecting the points.
What is the first step to use Matplotlib in your Python code?
✗ Incorrect
You must import Matplotlib before using its functions.
Explain how to create and display a simple line chart using Matplotlib.
Think about the steps from importing to showing the chart.
You got /3 concepts.
Describe how to add a title and axis labels to a Matplotlib chart and why it is important.
Labels tell us what the chart and axes mean.
You got /4 concepts.
