Recall & Review
beginner
What does a linear axis scale represent in a plot?
A linear axis scale shows data points spaced evenly according to their actual values. For example, the distance between 1 and 2 is the same as between 4 and 5.
Click to reveal answer
beginner
What is a logarithmic (log) axis scale?
A log axis scale spaces data points based on the logarithm of their values. This means equal distances represent equal ratios, not equal differences. It helps show data that changes exponentially.
Click to reveal answer
beginner
How do you set a logarithmic scale on the y-axis in matplotlib?
Use the command
plt.yscale('log') after plotting your data to change the y-axis to a logarithmic scale.Click to reveal answer
intermediate
Why might you choose a log scale over a linear scale?
You choose a log scale when data covers a wide range or grows exponentially. It makes it easier to see patterns and compare values that differ by large amounts.
Click to reveal answer
intermediate
What happens if you try to use a log scale with zero or negative values?
Log scales cannot display zero or negative values because logarithms of these numbers are undefined. You must remove or adjust such data before using a log scale.
Click to reveal answer
Which matplotlib command sets the x-axis to a logarithmic scale?
✗ Incorrect
Use plt.xscale('log') to set the x-axis to logarithmic scale.
What kind of data is best visualized with a log scale?
✗ Incorrect
Log scales help visualize data that grows exponentially or spans large ranges.
What will happen if you plot zero values on a log scale axis?
✗ Incorrect
Logarithms of zero are undefined, so zero values cause errors or are not shown on log scales.
Which axis scale spaces values evenly by their actual difference?
✗ Incorrect
Linear scales space values evenly by their actual difference.
How do you switch back to a linear scale on the y-axis in matplotlib?
✗ Incorrect
Use plt.yscale('linear') to set the y-axis back to linear scale.
Explain the difference between linear and logarithmic axis scales and when to use each.
Think about how distances between numbers appear on each scale.
You got /4 concepts.
Describe how to set a logarithmic scale on an axis using matplotlib and what to watch out for.
Recall the matplotlib commands and data requirements.
You got /4 concepts.