12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 07/09/2019
Data Visualization Using Pyplot: Line Chart, Pie Chart and Bar Chart
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
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.
Line chart
Bar chart
Pie chart
Scatter plot
2.
Read the code:
a. import matplotlib.pyplot as plt
b. plt.plot(3,2)
c. plt.show()
Identify the output for the above coding
3.
Read the following code: Identify the purpose of this code and choose the right option from the following.
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip list
List installed packages
list command
Install PIP
packages installed
4.
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
Check if PIP is Installed
Install PIP
Download a Package
Check PIP version
5.
Which is a python package used for 2D graphics?
matplotlib.pyplot
matplotlib.pip
matplotlib.numpy
matplotlib.plt
6.
Write the difference between the following functions: plt.plot([1,2,3,4]), plt.plot([1,2,3,4], [1,4,9,16]).
7.
8.
What is Data Visualization?
9.
Write the plot for the following pie chart output.
10.
Write any three uses of data visualization.
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 in Another Line! Whoa')
plt.show()
12.
Explain the various buttons in a matplotlib window.
13.
Explain in detail the types of pyplots using Matplotlib.
1.
(a)
Line chart
2.
(c)
3.
(d)
packages installed
4.
(d)
Check PIP version
5.
(a)
matplotlib.pyplot
6.
| plt.plot ([I,2,3,4]) | plt.pIot ([I,2,3,4], [1,4,9,16]) |
|---|---|
| 1. It refers y values as [1,2, 3,4] | 1. It refers x and y values as ([1, 2, 3, 4], [1,4,9, 16]) |
| 2. Indirectly it refers x values as [0, 1, 2, 3] (0,1),(1,2), 2,3), (3,4) | 2. Directly given in the function (1,1), (2,4), (3,9), (4,16) |
7.
8.
Data Visualization is the graphical representation of information and data. The objective of Data Visualization is to communicate information visually to users.
9.
Plot:
import matplotlib.pyplot as plt
sizes = [105, 30, 30, 195]
label= ["sleeping", "eating", "working", "playing"]
plt.pie (sizes, labels = labels, autopct = "%.2f")
plt, axes ( ). set_aspect ("equal")
plt.show ( )
10.
(i) Data Visualization help users to analyze and interpret the data easily.
(ii) It makes complex data understandable and usable.
(iii) Various Charts in Data Visualization helps to show relationship in the data for one or more variables.
11.
12.
(i) Home Button \(\rightarrow \) The Home Button will help one to begun navigating the chart. If you ever want to return back to the original view, you can click on this.
(ii) Forward/Back buttons \(\rightarrow \) These buttons can be used like the Forward and Back buttons in browser. Click these to move back to the previous point you were at, or forward again.
(iii) Pan Axis \(\rightarrow \) This cross-looking button allows you to click it, and then click and drag graph around.
(iv) Zoom \(\rightarrow \) The Zoom button lets you click on it, then click and drag a square would like to zoom into specifically. Zooming in will require a left click and drag. Zoom out with a right click and drag.
(v) Configure Subplots\(\rightarrow \) This button allows you to configure various spacing options with figure and plot.
(vi) Save Figure \(\rightarrow \)This button will allow you to save figure in various forms
13.
Line Chart:
(i) A Line Chart or Line Graph is a type of chart which displays information as a series of data points called 'markers' connected by straight line segments.
(ii) A Line Chart is often used to visualize a trend in data over intervals of time - a time series - thus the line is often drawn chronologically.
Example:
import matplotlib.pyplot as plt
years = [2014, 2015, 2016, 2017, 2018]
total_populations = [8939007, 8954518, 8960387, 8956741, 8943721]
plt. plot ("years, total_populations)
pit. title ("Year vs Population in India")
plt.xlabel ("Year")
pIt.ylabel ("Total Population")
plt.showt (1)
In this program,
Plt.titlet( ) \(\rightarrow\) specifies title to the graph
Plt.xlabelt) \(\rightarrow\) specifies label for X-axis
Plt.ylabel() \(\rightarrow\) specifies label for Y-axis
Output:
Bar Chart:
(i) A Bar Plot (or BarChart) is one of the most common type of plot. It shows the relationship between a numerical variable and a categorical variable
(ii) Bar chart represents categorical data with rectangular bars. Each bar has a height corresponds to the value it represents. The bars can be plotted vertically or horizontally.
(iii) It's useful when we want to compare a given numeric value on different categories. To make a bar chart with Matplotlib, we can use the plt.bar() function.
Example:
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.
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( )
Output:
Labels → specifies labels for the bars.
Usage → Assign values to the labels specified.
Xticks → Display the tick marks along the x - axis at the values represented. Then specify the ladel for each tick mark.
Range → Create sequence of numbers.
Pie Chart:
(i) Pie Chart is probably one of the most common type of chart. It is a circular graphic which is divided into slices to illustrate numerical proportion.
(ii) The point of a pie chart is to show the relationship of parts out of a whole. To make a Pie Chart with Matplotlib, we can use the plt.pief) function.
(iii) The autopct parameter allows us to display the percentage value using the Python string formatting.
Example:
import matplotlib.pyplot as plt
sizes = [89, 80, 90, 100, 75]
labels = ["Tamil", "English", "Maths", "Science", "Social"]
plt.pie (sizes, labels = labels, autopct = "%.2f")
plt.axes().set aspect ("equal")
plt.show( )
Output:
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards