CBSE Class 12 Informatics Practices
Question 30 of 73
Data Visualization using Matplotlib — Question 7
Back to all questionsplt.hist(x, bins=20, histtype="step")
Reason — The histtype parameter in the hist() function is used to specify the type of histogram to be created. In this case, histtype="step" is used to create a step histogram. The bins=20 parameter specifies that the histogram should be divided into 20 bins. Hence, the correct statement is plt.hist(x, bins=20, histtype="step").