Important QnA Histogram for Class 12 IP

Important QnA Histogram for Class 12 IP which is part of Chapter 3 Plotting with Pyplot. So here we go!

Imortant QnA Histogram for Class 12 IP – Objective type questions (1 Mark)

Fill in the blanks, MCQs and True/False

[1] A __________ is a tool that summarize discrete or continuous data.

–> Histogram

[2] The numerical data shown by the number of data points that fall within a particular range is called _______.

–> bins

[3] A histogram is a similar to a vertical bar graph. [True/False]

[4] Which of the following data can be shown by histogram?

a) The quantity like weight, height, time

b) The categories

c) The uncountable data

d) All of these

[5] The histogram was introduced by _________

–> Karl Pearson

[6] A ______ function is used to create histogram.

–> hist()

[7] How many parameters a hist() function can have?

a) 2

b) 3

c) 4

d) 5

[8] A _______ is a boolean parameter of hist() funtion which is by default False.

–> cumulative

[9]A _____ parameter is just a number or series or arrays to be plotted on histogram.

–> x

[10] Which of the following is traditional bar-type histogram?

a) x

b) bins

c) histtype

d) orientation

[11] Which of the following parameter have values like horizontal or vertical?

a) x

b) bins

c) histtype

d) orientation

[12] Which of the following is the correct statement to create a histogram with ndarray x and bins value 30?

a) hist(x,bins:30)

b) hist(x,bins=30)

c) hist(x,bins-30)

d) hist(x,bins,30)

[13] A ________ value should be specified to histtype to generate a lineplot that is by default unfilled.

–> step

[14]You cannot create horizontal stacked histogram. (True/False)

[15] Which of the following is correct to generate horizontal stacked histogram?

a) hist([x,y], histtype=’barstacked’, orientation = ‘horizontal’)

b) hist([x,y], histtype=’horizontal’, orientation=’barstacked’)

c) b) hist([x,y], histtype=’horizontal’, orientation=’landscape’)

d) None of these

Histogram for Class 12 IP – Conceptual Descriptive/Subjective Questions

Refer these notes to write answers.

[1] Describe the histogram. How to plot data on histogram?

[2] Explain hist() function in detailed.

[3] Clarify the situations when you need to use bar() charts and when you need to use hist() chart?

[4]What is the significance of the cumulative histogram? Elaborate your answer with an example.

[5] How to change the edgecolor and color of histogram bar?

[6] Explain the following parameters of hist() function with example.

  1. bins
  2. histtype
  3. orientation

[7] How to save the histogram as image?

Histogram for Class 12 IP – Application-based questions

[1] Write code to plot following data on histogram:

24,17,14,22,25,26,38,42,24,12,28,19,32,21,35,28,21,31,18,19

import matplotlib.pyplot as mp
l=[24,17,14,22,25,26,38,42,24,12,28,19,32,21,35,28,21,31,18,19]
mp.hist(l)
mp.show()

[2] Generate random numbers from 1 to 70 and plot it on the histogram. Change the outline color to black and the bar color should be yellow.

import matplotlib.pyplot as m
import numpy as np
x=np.random.randn(70)
m.hist(x,20,edgecolor="black",facecolor="yellow")
m.show()

[3] Display the above data in cumulative mode on histogram.

import matplotlib.pyplot as m
import numpy as np
x=np.random.randn(70)
m.hist(x,20,cumulative= True, edgecolor=”black”,facecolor=”yellow”)
m.show()

[4] Write python code to create histogram based on given data:

rcb: 78,63,49,41,68,101,56,79,68,96

mi: 45,85,98,102,42,50,43,48,63,39

import matplotlib.pyplot as m
rcb=[78,63,49,41,68,101,56,79,68,96]
mi=[45,85,98,102,42,50,43,48,63,39]
m.hist([rcb,mi],cumulative='true')
m.show()

[5] Draw histogram for the following code:

import matplotlib.pyplot as m
english=[77,66,88,99,55,44,33,79,68,83]
maths=[56,89,70,50,60,65,90,80,47,82]
m.hist([english,maths], orientation='horizontal')
m.show()

Thank you for your visit and for reading this article Important QnA Histogram for Class 12 IP.

Share with your friends and classmates. Feel free to ask your doubt in the comment section as well.

Unlock following link to get the pdf solution.

Watch this video for more understanding.

Share this video with your friends and in your circle. If you have any doubts or queries feel free to write in the comment section.

Your suggestions/views/feedbacks are always welcome. Write your views/suggestions/feedbacks in the comment section to improve our contents.

If you have any other concern related to out blog you can use our contact us section to inform us. We will try to resolve the concern.

Thank you for visit.

Comment Your Views

%d bloggers like this: