Class 12 Informatics Practices Data Visualization using Python Matplotlib MCQ’s Set 1

Plotting in Python using Matplotlib


Purpose of plotting, drawing and saving of plots using Matplotlib (line plot, bar graph, histogram). Customizing plots:- adding label, title, and legend in plots.


Data Visualization in Python – Multiple Choice Questions



Multiple Choice Questions – Set 1


1. _______________ means graphical or pictorial representation of the data using graph, chart, etc.

a. Flow chart

b. Graphics

c. Data visualisation

d. None of these

Answer: c. Data visualisation

2. What is the purpose of plotting date?

a. Visualise variation

b. show relationship between variables

c. Both (a) and (b)

d. None of these

Answer: c. Both (a) and (b)

3. __________ helps to effectively communicate information to intended users.

a. Visualisation

b. Graphics

c. Both (a) and (b)

d. None of these

Answer: a. Visualisation

4. Which library of Python is use to plot charts such as line, bar, scatter, histograms ?

a. pandas

b. matplotlib

c. numpy

d. None of these

Answer: b. matplotlib

5. __________ library is used for creating static, animated, and interactive 2D- plots or figures in Python.

a. pandas

b. matplotlib

c. numpy

d. None of these

Answer: b. matplotlib

6. Which command is use to install matplotlib library?

a. pip

b. install

c. download

d. None of these

Answer: a. pip

7. Which of the following command is valid to install the matplotlib library?

a. pip matplotlib

b. pip install matplotlib

c. install pip matplotlib

d. None of these

Answer: b. pip install matplotlib

8. _________ module (interface) of matplotlib allows to construct 2D plots.

a. syplot

b. drawplot

c. pyplot

d. None of these

Answer: c. pyplot

9. Write the command to import the matplotlib library in you Python environment.

a. import matplotlib.pyplot

b. #include <matplotlib.pyplot>

c. inport matplotlib.pyplot

d. None of these

Answer: a. import matplotlib.pyplot

10. What is plt in the given statment?

import matplotlib.pyplot as plt

a. an alias

b. an alternative name for matplotlib.pyplot

c. argument of import statement

d. Both (a) and (b)

Answer: d. Both (a) and (b)

11. The _______ module of matplotlib contains a collection of functions that can be used to work on a plot.

a. pyplot

b. matplotlib

c. python pandas

d. None of these

Answer: a. pyplot

12. The _______ function of the pyplot module is used to create a figure i.e. graph.

a. bar()

b. hist()

c. plot()

d. None of these

Answer: c. plot()

13. A ______ is the overall window where the outputs of pyplot functions are plotted.

a. graph

b. figure

c. image

d. None of these

Answer: b. figure

14. A figure contains a __________________.

a. plotting area

b. legend

c. axis labels

d. ticks

e. title

f. All of the above

Answer: f. All of the above

15. Which of the following is not a component of chart?

a. Chart Title

b. Axis Title

c. Legend

d. Chart Labels

Answer: d. Chart labels

15. Which of the following function is used to plot a graph x versus y in matplotlib.pyplot?

a. plot()

b. draw()

c. hist()

d. None of these

Answer: a. Chart labels

16. Which one is the valid statement to invoke the plot() function?

a. plot(x, y)

b. pyplot.plot(x,y)

c. matplotlib.pyplot.plot(x,y)

d. None of these

Answer: c. matplotlib.pyplot.plot(x,y)

17. How to invoke the plot() function, if you have written an import statement given below?

import matplotlib.pyplot as myplt

a. pyplot.plot(x, y)

b. myplt.plot(x,y)

c. matplotlib.pyplot.plot(x,y)

d. None of these

Answer: b. myplt.plot(x,y)

18. The PyPlot interface provides many methods for ________ plotting of data.

a. 1 D

b. 2 D

c. 3 D

d. None of these

Answer: b. 2 D

19. The matplotlib library is preinstalled with ________.

a. Python IDLE

b. Spyder IDE

c. Anaconda distribution

d. None of these

Answer: c. Anaconda distribution

20. _________ function is used to display the figure created using the plot() function.

a. show()

b. display()

c. paint()

d. None of these

Answer: a. show()


Class 12 Informatics Practices : Data Visualization – Plotting in Python MCQ’s


Class 12 Informatics Practices – Data Handling Using Pandas – I Multiple Choice Questions



Class 12 Informatics Practices Societal Impacts Multiple Choice Questions



Class 12 Informatics Practices : NCERT Exercise Solutions



You cannot copy content of this page

Scroll to Top