0
0
Matplotlibdata~10 mins

Why interactivity enhances exploration in Matplotlib - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the matplotlib library for plotting.

Matplotlib
import [1] as plt
Drag options to blanks, or click blank then click option'
Apandas
Bseaborn
Cnumpy
Dmatplotlib.pyplot
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the whole matplotlib instead of pyplot.
Using unrelated libraries like pandas or numpy for plotting.
2fill in blank
medium

Complete the code to enable interactive mode in matplotlib.

Matplotlib
plt.[1]()
Drag options to blanks, or click blank then click option'
Aion
Bshow
Cinteractive
Dplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.show(True) which does not enable interactive mode.
Trying plt.interactive(True) which is not a valid function.
3fill in blank
hard

Fix the error in the code to update the plot dynamically.

Matplotlib
plt.plot(x, y)
plt.[1]()
Drag options to blanks, or click blank then click option'
Apause
Bdraw
Cshow
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using plt.show() which blocks execution.
Using plt.pause() without arguments.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters data points with y values greater than 5.

Matplotlib
filtered_points = {x: y for x, y in data.items() if y [1] 5 and 'point' [2] x}
Drag options to blanks, or click blank then click option'
A>
B<
Cin
Dnot in
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' for filtering.
Using 'not in' which excludes keys containing 'point'.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that converts keys to uppercase, keeps values, and filters values greater than 10.

Matplotlib
result = { [1]: [2] for k, v in data.items() if v [3] 10 }
Drag options to blanks, or click blank then click option'
Ak.lower()
Bv
C>
Dk.upper()
Attempts:
3 left
💡 Hint
Common Mistakes
Using k.lower() instead of k.upper() for keys.
Using '<' instead of '>' for filtering values.