" /> -->

#### Data Visualization Using Pyplot: Line Chart, Pie Chart and Bar Chart Book Back Questions

12th Standard EM

Reg.No. :
•
•
•
•
•
•

Computer Science

Time : 00:45:00 Hrs
Total Marks : 30
5 x 1 = 5
1. Which is a python package used for 2D graphics?

(a)

matplotlib.pyplot

(b)

matplotlib.pip

(c)

matplotlib.numpy

(d)

matplotlib.plt

2. Read the following code: Identify the purpose of this code and choose the right option from the following.
C:\Users\YourName\AppData\Local\Programs\Python\Python36-32\Scripts>pip –version

(a)

Check if PIP is Installed

(b)

Install PIP

(c)

(d)

Check PIP version

3. Read the following code: Identify the purpose of this code and choose the right option from the following.

(a)

List installed packages

(b)

list command

(c)

Install PIP

(d)

packages installed

a. import matplotlib.pyplot as plt
b. plt.plot(3,2)
c. plt.show()
Identify the output for the above coding

(a)

(b)

(c)

(d)

5. Identify the right type of chart using the following hints.
Hint 1: This chart is often used to visualize a trend in data over intervals of time.
Hint 2: The line in this type of chart is often drawn chronologically.

(a)

Line chart

(b)

Bar chart

(c)

Pie chart

(d)

Scatter plot

6. 3 x 2 = 6
7. Define: Data Visualization.

8. How will you install Matplotlib?

9. Write the difference between the following functions: plt.plot([1,2,3,4]), plt.plot([1,2,3,4], [1,4,9,16]).

10. 3 x 3 = 9
11. Draw the output for the following data visualization plot.
import matplotlib.pyplot as plt
plt.bar([1,3,5,7,9],[5,2,7,8,2], label="Example one")
plt.bar([2,4,6,8,10],[8,6,2,5,6], label="Example two", color='g')
plt.legend()
plt.xlabel('bar number')
plt.ylabel('bar height')
plt.title('Epic Graph\nAnother Line! Whoa')
plt.show()

12. Write any three uses of data visualization.

13. Write the plot for the following pie chart output.

14. 2 x 5 = 10
15. Explain in detail the types of pyplots using Matplotlib.

16. Explain the various buttons in a matplotlib window.