Complete the code to import the library needed to create histograms.
import [1] as plt
We use matplotlib.pyplot to create histograms in Python.
Complete the code to create a histogram of the data list.
data = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4] plt.[1](data) plt.show()
The hist function creates a histogram to show data distribution.
Fix the error in the code to correctly label the x-axis.
plt.hist(data)
plt.xlabel([1])
plt.show()The label text must be a string, so it needs quotes.
Fill both blanks to create a histogram with 5 bins and a title.
plt.hist(data, bins=[1]) plt.title([2]) plt.show()
Setting bins to 5 groups data into 5 parts. The title must be a string.
Fill all three blanks to create a histogram with green color, 8 bins, and x-axis label 'Scores'.
plt.hist(data, bins=[1], color=[2]) plt.xlabel([3]) plt.show()
Bins is a number (8), color is a string ('green'), and xlabel is a string ('Scores').
