0
0
Matplotlibdata~10 mins

Why statistical plots reveal data patterns 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 plotting library.

Matplotlib
import [1] as plt
Drag options to blanks, or click blank then click option'
Amatplotlib.pyplot
Bseaborn
Cpandas
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Importing numpy or pandas instead of matplotlib.pyplot
Using seaborn without importing matplotlib.pyplot
2fill in blank
medium

Complete the code to create a simple line plot of data.

Matplotlib
plt.[1]([1, 2, 3, 4], [10, 20, 25, 30])
plt.show()
Drag options to blanks, or click blank then click option'
Ahist
Bplot
Cscatter
Dbar
Attempts:
3 left
💡 Hint
Common Mistakes
Using scatter instead of plot for line graphs
Using hist which is for histograms
3fill in blank
hard

Fix the error in the code to display a histogram of data.

Matplotlib
data = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]
plt.hist([1])
plt.show()
Drag options to blanks, or click blank then click option'
Alist
Bplt
Chist
Ddata
Attempts:
3 left
💡 Hint
Common Mistakes
Passing plt or hist instead of the data list
Passing a string instead of the variable
4fill in blank
hard

Fill both blanks to create a scatter plot with labels.

Matplotlib
plt.[1](x, y)
plt.[2]()
Drag options to blanks, or click blank then click option'
Ascatter
Bshow
Cplot
Dhist
Attempts:
3 left
💡 Hint
Common Mistakes
Using plot instead of scatter for points
Forgetting to call show()
5fill in blank
hard

Fill all three blanks to create a bar chart with labels and title.

Matplotlib
plt.bar([1], [2])
plt.xlabel([3])
plt.show()
Drag options to blanks, or click blank then click option'
Acategories
Bvalues
C"Category Names"
D"Values"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping categories and values
Not labeling the axes