Quiz: Python Plotting with Matplotlib
Main.PythonQuiz9 History
Hide minor edits - Show changes to markup
(:title Quiz: Python Plotting with Matplotlib:) (:keywords quiz, test, Python, plot, graph, scatter, introduction, course:) (:description Learning assessment on Python plotting with Matplotlib.:)
1. How do you plot a function y = f(x) after the statement import matplotlib.pyplot as plt?
(:div id=q1a:)
- Incorrect. Use plt.plot(x,y) instead to indicate that the plt package is used to create the plot.
(:divend:)
(:div id=q1b:)
- Incorrect. Use plt.plot(x,y) to use the plot function.
(:divend:)
(:div id=q1c:)
- Incorrect. Use plt.plot(x,y) with matplotlib.pyplot renamed as plt as a shortened name.
(:divend:)
(:div id=q1d:)
- Correct.
(:divend:)
(:div id=q1e:)
- Incorrect. Switch the x and y and use plt. at the beginning.
(:divend:)
2. What is the symbol code for a black dashed line when plotting x and y?
(:div id=q2a:)
- Incorrect. Blue solid line.
(:divend:)
(:div id=q2b:)
- Correct. Black dashed line.
(:divend:)
(:div id=q2c:)
- Incorrect. Blue bashed line.
(:divend:)
3. Why is it important to create a plot with trends that can be distinguished without color? Other things like line style or width are needed to distinguish trends. Select all that apply.
(:div id=q3a:)
- Correct. There are an estimated 300 million people in the world with color vision deficiency. 1 in 12 men are color blind (8%). 1 in 200 women are color blind (0.5%).
(:divend:)
(:div id=q3b:)
- Correct.
(:divend:)
(:div id=q3c:)
- Incorrect. That statement is true, but does not explain why plots should be distinguished without color.
(:divend:)