St. Britto Hr. Sec. School - Madurai
12th Computer Science Weekly Test - 1 ( Data visualization using pyplot: line chart, pie chart and b-Aug 2020
-
-
-
-
-
-
-
-
-
-
-
-
-
How will you install Matplotlib?
-
List the general types of data visualization.
-
What are the two ways to display data in the form of diagram?
-
List the buttons in matlibplot window.
-
import matplotlib.pyplot as plt
# Our data
labels = ["TAMIL", "ENGLISH", "MATHS", "PHYSICS", "CHEMISTRY", "CS"]
usage = [79.8, 67.3, 77.8, 68.4, 70.2, 88.5]
# Generating the y positions. Later, we'll use them to replace them with labels.
y_positions = range (len(labels))
# Creating our bar plot
plt.bar (y_positions, usage)
plt.xticks (y_positions, labels)
plt.ylabel ("RANGE")
plt.title ("MARKS")
plt.show() -
-
Read the following code. What does the following represents.
(i) Labels
(ii) Usage
(iii) X ticks
(iv) Range
(v) Show -
import matplotlib.pyplot as plt
years = [2014, 2015, 2016, 2017, 2018]
total_populations = [8939007, 8954518, 8960387, 8956741, 8943721]
plt.plot (years, total_populations)
plt.title ("Year vs Population in India")
plt.xlabel ("Year")
plt.ylabel ("Total Population")
plt.show()
In this program,
Plt.title() → specifies title to the graph
Plt.xlabel() → specifies label for X-axis
Plt.ylabel() → specifies label for Y-axis
-
-
Write any three uses of data visualization.
-
Write the coding for the following:
a. To check if PIP is Installed in your PC.
b. To Check the version of PIP installed in your PC.
c. To list the packages in matplotlib. -
Explain in detail the types of pyplots using Matplotlib.
-
Explain the purpose of the following functions:
a. plt.xlabel
b. plt.ylabel
c. plt.title
d. plt.legend()
e. plt.show() -
-
Write the key differences between Histogram and bar graph.
-
Explain the various buttons in a matplotlib window.
-