Matplotlib Histogram MCQs | 25 Practice Questions with Answers | CBSE Class 12 Informatics Practices (IP)
Class 12 · Informatics Practices
Matplotlib Histogram MCQs (25 Questions)
Practice these multiple-choice questions to strengthen your understanding of Matplotlib Histograms. Click Show Answer to reveal the correct answer and explanation.
Q1. A histogram is mainly used to represent:
A. Categorical data
B. Continuous numerical data
C. Text data
D. Database records
Show Answer
Answer: B. Continuous numerical data
Explanation: A histogram is used to display the frequency distribution of continuous numerical data.
Q2. Which Matplotlib function is used to create a histogram?
A. plt.bar()
B. plt.plot()
C. plt.hist()
D. plt.barh()
Show Answer
Answer: C. plt.hist()
Explanation: The hist() function creates a histogram.
Q3. What does a histogram show?
A. Relationship between variables
B. Frequency distribution of data
C. Program execution time
D. Database records
Show Answer
Answer: B. Frequency distribution of data
Explanation: A histogram displays how frequently values occur within specified intervals.
Q4. In a histogram, adjacent bars are:
A. Always separated by gaps
B. Touching each other
C. Circular in shape
D. Drawn diagonally
Show Answer
Answer: B. Touching each other
Explanation: Since histograms represent continuous data, the bars touch each other.
Q5. The intervals used in a histogram are called:
A. Labels
B. Bins
C. Rows
D. Columns
Show Answer
Answer: B. Bins
Explanation: Bins divide continuous data into intervals for frequency analysis.
Q6. Which graph is most suitable for showing the distribution of students' marks?
A. Histogram
B. Bar Graph
C. Line Plot
D. Pie Chart
Show Answer
Answer: A. Histogram
Explanation: A histogram shows how marks are distributed across different ranges.
Q7. Which graph is used to analyze frequency distribution?
A. Histogram
B. Bar Graph
C. Line Plot
D. Scatter Plot
Show Answer
Answer: A. Histogram
Explanation: Histograms are specifically designed for frequency distribution analysis.
Q8. Which statement correctly creates a histogram?
A. plt.plot(data)
B. plt.hist(data)
C. plt.bar(data)
D. plt.barh(data)
Show Answer
Answer: B.
Explanation: The hist() function creates a histogram from numerical data.
Q9. Which graph is best suited for analyzing the age distribution of employees?
A. Histogram
B. Bar Graph
C. Line Plot
D. Pie Chart
Show Answer
Answer: A.
Explanation: Age is continuous numerical data, making a histogram appropriate.
Q10. Which statement about histograms is TRUE?
A. They represent continuous data.
B. Bars touch each other.
C. They show frequency distribution.
D. All of these.
Show Answer
Answer: D.
Explanation: Histograms display the frequency distribution of continuous data using adjoining bars.
Q11. Which of the following is an example of continuous data?
A. Height of students
B. Number of books
C. Roll numbers
D. House names
Show Answer
Answer: A.
Explanation: Height is measured on a continuous scale.
Q12. Which graph would best represent the frequency distribution of rainfall data?
A. Histogram
B. Bar Graph
C. Pie Chart
D. Line Plot
Show Answer
Answer: A.
Explanation: Rainfall measurements are continuous data and are best represented using a histogram.
Q13. In a histogram, the X-axis usually represents:
A. Categories
B. Class intervals (bins)
C. Program names
D. File names
Show Answer
Answer: B.
Explanation: The X-axis represents class intervals (bins), while the Y-axis shows frequencies.
Q14. In a histogram, the Y-axis generally represents:
A. Categories
B. Frequency
C. Labels
D. Time
Show Answer
Answer: B.
Explanation: The Y-axis indicates the frequency of observations in each bin.
Q15. Which statement about Matplotlib Histograms is correct?
A. plt.hist() is used to create histograms.
B. Histograms display frequency distributions.
C. Histograms are suitable for continuous data.
D. All of these.
Show Answer
Answer: D.
Explanation: Matplotlib's hist() function creates histograms to visualize the distribution of continuous data.
Q16. What is the purpose of bins in a histogram?
A. To store data in a database
B. To divide continuous data into intervals
C. To label the X-axis
D. To save the graph
Show Answer
Answer: B. To divide continuous data into intervals
Explanation: Bins group continuous data into intervals so that the frequency of values in each interval can be displayed.
Q17. Which graph is most suitable for showing the distribution of students' heights in a class?
A. Bar Graph
B. Histogram
C. Line Plot
D. Pie Chart
Show Answer
Answer: B. Histogram
Explanation: Height is continuous numerical data, making a histogram the most appropriate graph.
Q18. A hospital wants to analyze the age distribution of patients. Which graph should be used?
A. Line Plot
B. Histogram
C. Bar Graph
D. Pie Chart
Show Answer
Answer: B. Histogram
Explanation: Age is continuous data, and a histogram effectively shows its frequency distribution.
Q19. Which graph is most appropriate for displaying the frequency distribution of examination marks?
A. Histogram
B. Bar Graph
C. Line Plot
D. Scatter Plot
Show Answer
Answer: A. Histogram
Explanation: Histograms group marks into intervals and display the number of students in each range.
Q20. Which statement correctly differentiates a Histogram from a Bar Graph?
A. Histogram bars touch each other, while bar graph bars are separated by gaps.
B. Histogram is used for continuous data, while bar graph is used for categorical data.
C. Both A and B
D. Neither A nor B
Show Answer
Answer: C. Both A and B
Explanation: Histograms represent continuous data with adjoining bars, whereas bar graphs compare discrete categories using separated bars.
Q21. Which graph should be used to compare the sales of different products?
A. Histogram
B. Bar Graph
C. Line Plot
D. Histogram only
Show Answer
Answer: B. Bar Graph
Explanation: Products are categories, so a bar graph is the correct choice.
Q22. Which graph would best represent the distribution of daily temperatures recorded over a month?
A. Histogram
B. Bar Graph
C. Pie Chart
D. Flowchart
Show Answer
Answer: A. Histogram
Explanation: Temperature is continuous numerical data, making a histogram suitable for showing its distribution.
Q23. Which of the following statements about Histograms is TRUE?
A. They are created using plt.hist().
B. They use bins to group data.
C. They show frequency distribution.
D. All of these.
Show Answer
Answer: D. All of these.
Explanation: Histograms are created using plt.hist(), group data into bins, and display frequency distributions.
Q24. Which statement about a Histogram is correct?
A. It represents continuous numerical data.
B. Adjacent bars touch each other.
C. It is useful for analyzing frequency distribution.
D. All of these.
Show Answer
Answer: D. All of these.
Explanation: A histogram is specifically designed to display the frequency distribution of continuous numerical data.
Q25. Which statement best summarizes Histograms?
A. They represent continuous data using adjoining bars.
B. They group observations into bins.
C. They are useful for studying frequency distributions.
D. All of these.
Show Answer
Answer: D. All of these.
Explanation: Histograms divide continuous data into intervals (bins) and display how frequently values occur in each interval.
Answer Key
| Q.No. | Answer | Q.No. | Answer | Q.No. | Answer |
|---|---|---|---|---|---|
| 1 | B | 11 | A | 21 | B |
| 2 | C | 12 | A | 22 | A |
| 3 | B | 13 | B | 23 | D |
| 4 | B | 14 | B | 24 | D |
| 5 | B | 15 | D | 25 | D |
| 6 | A | 16 | B | ||
| 7 | A | 17 | B | ||
| 8 | B | 18 | B | ||
| 9 | A | 19 | A | ||
| 10 | D | 20 | C |
Practice Tips
- Remember the Matplotlib function:
plt.hist()→ Creates a Histogram.
- Understand the purpose of a Histogram:
- Displays the frequency distribution of continuous numerical data.
- Groups observations into intervals called bins.
- Know the key characteristics:
- Represents continuous data.
- Bars touch each other.
- X-axis shows class intervals (bins).
- Y-axis shows frequency.
- Common real-life applications:
- Distribution of examination marks
- Students' heights and weights
- Employee age distribution
- Rainfall measurements
- Temperature records
- Remember the difference between a Histogram and a Bar Graph:
- Histogram → Continuous data, adjoining bars, frequency distribution.
- Bar Graph → Categorical data, separated bars, comparison of categories.
- CBSE Tip: Scenario-based questions often ask you to choose the correct graph. If the data is grouped into ranges or intervals and represents continuous numerical values, the correct choice is a Histogram.