You are on page 1of 10

S.E.

SOCIETY’S

SNBP INTERNATIONAL SCHOOL & KIDZONE


MORWADI, PIMPRI, PUNE
CBSE AFFILIATION NO. 1130522

Class:- 12TH Div:- Sub: - Informatics Practices Date: -


Plotting with pyplot Worksheet No 1
Name:- Roll No:-

Q1. Which Python package is used for 2D graphics?

(a) matplotlib.pyplot

(b) matplotlib.pip

(c) matplotlib.numpy

(d) matplotlib.plt

Q2. The most popular data visualization library in Python is:

(a) pip

(b) matinfolib

(c) matplotlib

(d) matpiplib

Q3. Which of the following commands is used to install matplotlib for coding?

(a) import plt.matplotlib as plot

(b) import plot.matplotlib as pt

(c) import matplotlib.plt as plot

(d) import matplotlib.pyplot as plt

Grade 12/IP/Worksheet 1/2023-2024 Page 1


Q4. Which of the following methods should be employed in the code to display a plot()?

(a) show()

(b) display()

(c) execute()

(d) plot()

Q5. PyPlot is an interface of Python’s ____________ library.

a) Seaborn b) plotly c) ggplot d) matplotlib

Q6. Which of the following is not a valid chart type?

a) Histogram b) statistical c) pie d) box

Q7. For 2D plotting using a Python library, which library interface is often used ?

(a) seaborn

(b) plotly

(c) matplotlib

(d) matplotlib.pyplot

Q8. Which of the following is not a valid plotting function of pyplot?

(a) plot() (b) bar() (c) line() (d) pie()

Q9. Which of the following plotting functions does not plot multiple data series?

(a) plot() (b) bar() (c) pie() (d) barh()

Q10. The plot which tells the trend between two graphed variables is the _____

graph/chart.

(a) line (b) scatter (c) bar (d) pie

Grade 12/IP/Worksheet 1/2023-2024 Page 2


S.E. SOCIETY’S

SNBP INTERNATIONAL SCHOOL & KIDZONE


MORWADI, PIMPRI, PUNE
CBSE AFFILIATION NO. 1130522

Class:- 12TH Div:- Sub: - Informatics Practices Date: -


Plotting with pyplot Worksheet No 2
Name:- Roll No:-

Q1. A visual representation of the statistic five number summary of a given dataset is
known as _____.
(a) histogram
(b) frequency distribution
(c) boxplot
(d) frequency polygon

Q2. Which of the following functions is used to create a line chart?


(a) line()
(b) plot()
(c) chart()
(d) plotline()

Q3. Which shape of marker will be printed in the scatter chart made using following

Code : plt.scatter(x,y,marker=’D’)

(a) Down triangle


(b) Diamond
(c) Double circle
(d) Donut

Q4. The plot which tells the correlation between two variables which may not be

directly related is _____ graph/chart.


(a) line (b) scatter (c) bar (d) pie
Q5. A _____ is a summarisation tool for discrete or continuous data.
Grade 12/IP/Worksheet 1/2023-2024 Page 1
(a) quartile
(b) histogram
(c) mean
(d) median
Q6. When should you use i) line chart ii) scatter chart.

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Q7. Name the function to create line chart.

____________________________________________________________________

Q8. Name the function to create scatter chart.

____________________________________________________________________
Q9. Raju want to create scatter chart for the given data

X=[1,2,3,4]

Y=[12,23,16,28]

Help him to write correct code (important libraries are imported)

a. Plt.plot(x,y,’o’)

b. Plt.scatter(x,y)

c. Df=pd.DataFrame({‘c1,:x,’c2’:y})

Df.plot(kind=scatter,x=’c1’,y=’c2’)

d. All of the above

Grade 12/IP/Worksheet 1/2023-2024 Page 2


S.E. SOCIETY’S

SNBP INTERNATIONAL SCHOOL & KIDZONE


MORWADI, PIMPRI, PUNE
CBSE AFFILIATION NO. 1130522

Class:- 12TH Div:- Sub: - Informatics Practices Date: -


Plotting with pyplot Worksheet No 3
Name:- Roll No:-

Q1. When should you use i) bar chart ii) pie chart

__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

Q2. Name the function to create bar chart.

____________________________________________________________________

Q3. Name the function to create pie chart.

____________________________________________________________________
Q4. Compare bar() and barh() functions.

____________________________________________________________________

_____________________________________________________________________

Q5 . Which of the following function will produce a bar chart?

(a) plot() (b) bar()

(c) plotbar() (d) barh()

Grade 12/IP/Worksheet 1/2023-2024 Page 1


Q6. Which of the following option describes a pie chart?

a. Comparison in different categories of data

b. Relationship between two sets of numeric data

c. Contribution of individual values to a total value

d. Data trend over a period of time

Q7. Which of the following is not a type of bar chart?

a. Column chart b. Bar chart

c. Histogram d. scatter chart

Q8. Graph which can be plotted vertically or horizontally is :

a. Bar b. Scatter

c. Line d. Pie

Q9. There is no gap between bars in histogram however in bar chart gap is exists.

a. True b. False

Q10. To create column chart we can use

a. Bar() b. barh()

c. box() d. plot()

Q11. The order of bars plotted may be different from the order in actual data sequence.

a. True b.False

Grade 12/IP/Worksheet 1/2023-2024 Page 2


S.E. SOCIETY’S

SNBP INTERNATIONAL SCHOOL & KIDZONE


MORWADI, PIMPRI, PUNE
CBSE AFFILIATION NO. 1130522

Class:- 12TH Div:- Sub: - Informatics Practices Date: -


Plotting with pyplot Worksheet No 4
Name:- Roll No:-

Q1 .The data points in a line chart is known as__

(a) indicators (b) markers

(c) locators (d) none of these

Q2. Which of the following option describes a pie chart?

a. Comparison in different categories of data

b. Relationship between two sets of numeric data

c. Contribution of individual values to a total value

d. Data trend over a period of time

Q3. Which function can plot box graph?

a. box() b. boxplot()

c. plotbox() d. none of these

Q4. What do you mean by customization of plots?

a. Adding title b. showing legends

c. Showing x and y labels d. All of these

Grade 12/IP/Worksheet 1/2023-2024 Page 1


Q5. To plot x versus y , we can write ________ #plt is an alias for matplotlib.pyplot.

a. Plt.plot(y,x)

b. Plt.plot(x)

c. Plt.plot(x,y)

d. None of the above

Q6. Which attribute of plot() function is used to set the edge color of bar in bar chart?

a. bordercolor b. colorofedge

c. edgecolor d. none of the above

Q7. Fill in the blank in the given code, if we want to plot a line chart for values of list ‘a’

Vs values of list ‘b’.

a=[1,2,3,4,5]

b=[10,20,30,40,50]

import matplotlib.pyplot as plt

plt.plot__________

a. (a,b) b. (b,a) c. [a,b] d. None of these

Q8. What is a histogram?

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Grade 12/IP/Worksheet 1/2023-2024 Page 2


S.E. SOCIETY’S

SNBP INTERNATIONAL SCHOOL & KIDZONE


MORWADI, PIMPRI, PUNE
CBSE AFFILIATION NO. 1130522

Class:- 12TH Div:- Sub: - Informatics Practices Date: -


Plotting with pyplot Worksheet No 5
Name:- Roll No:-

Q1. By default plot() function plots a _____________

a. histogram b. bar graph

c. line chart d. pie chart

Q2. Write a statement to display “Amount” as x-axis label.(consider plt as an alias

Name of matplotlib.pyplot)

a. Plt.label(“Amount”) b. Plt.xlabel(“Amount”)

c. Plt.xlabel(Amount) d. None of these

Q3. Which function is used to create a histogram?

a. histo() b. histogram()

c. hist() d. histtype()

Q4. Which function is used to show legends?

a. Display() b. show()

c. legend() d. legends()

Q5. Which is not true about Data visualization?

Grade 12/IP/Worksheet 1/2023-2024 Page 1


a. Graphical representation of information and data .

b. Helps users in analyzing large amount of data in simpler way.

c. Data visualization makes complex data more accessible, understandable and

usable

d. No library needs to be imported to creates charts in python languages.

Q6. Which attribute of plot() function to specify the type of chart?

a. Type b. kind

c. kinds d. types

Q7. Mr. Sanjay wants to plot a bar graph for the given set of values of subject on x-axis
and number of students who opted for that subject on y-axis. Complete the code to
perform the following : (i) To plot the bar graph in statement 1 (ii) To display the graph in
statement 2

import matplotlib.pyplot as plt

x=['Hindi', 'English', 'Science', 'SST']

y=[10,20,30,40]

_____________________ Statement 1

_____________________ Statement 2

Q8. What is the use of matplotlib and pyplot?

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Grade 12/IP/Worksheet 1/2023-2024 Page 2

You might also like