Please refer to Computer Science For Data Visualization Using Pyplot Class 12 Computer Science Exam Questions provided below. These questions and answers for Class 12 Computer Science have been designed based on the past trend of questions and important topics in your class 12 Computer Science books. You should go through all Class 12 Computer Science Important Questions provided by our teachers which will help you to get more marks in upcoming exams.
Class 12 Computer Science Exam Questions Data Visualization Using Pyplot
Very Short Answer Type Questions :
Question. Is Python useful in Data Visualization?
Answer: Python is a very powerful programming language that support Data Visualization utilities. It may be used for various business applications.
Question. How to install matplotlib in Python?
Answer: We can install matplotlib using pip command when internet is connected to our computer system.
Question. Is Anaconda Python required matplotlib installation?
Answer: NO, Anaconda Python is not required to installed. When we install Anaconda Python, it install automatically.
Question. What is Pyplot?
Answer: Pyplot is a collection of methods within matplotlib library of Python.
Question. Write down commands to install matplotlib in Python.
Answer: python –m pip install –u pip
python –m pip install –u matplotlib
Question. What are the ways to import pyplot in Python program?
Answer: import matplotlib.pyplot
or
import matplotlib.pyplot as plt
Question. Which function is used to draw line chart in Python?
Answer: plot()
Question. How data visualization is useful?
Answer: Data visualization can display patterns, trends, correlation, outliers using chart, graphs, pie etc that helps in decision making in business firms.
Question. Which function is used to specify y axes label in chart?
Answer: ylabel()
Question. Which function is used to display line chart on screen in Python?
Answer: Show()
Question. Which function is used to specify x axes label in chart?
Answer: xlabel()
Question. What is data visualization?
Answer: Data Visualization refers to the graphical or visual representation of information and data using visual elements like chart, graph, map etc.
Question. What is matplotlib?
Answer: Matplotlib is a high quality plotting library of Python.
Question. Which function is used to specify title of chart?
Answer: title()
Short Answer Type Questions :
Question. What is Bar Chart?
Answer: A Bar Chart/Graph is a graphical display of data using bars of different heights.
Question. Which function is used to draw a bar graph in Python?
Answer: bar()
Question. Which Python object can be used for data in bar graph?
Answer: List can be used for data in bar graph.
Question. Draw a bar graph in Python.
Answer: import matplotlib.pyplot as plt
xdata=[1,2,3,4,5]
ydata=[10,20,30,40,50]
plt.bar(xdata,ydata)
plt.show()
it will show bar graph like:

Question. How to add x axes, y axes label and title of bar graph? Show with an example.
Answer: import matplotlib.pyplot as plt
x=[1,2,3,4,5]
y=[10,20,30,40,50]
26 | P a g e
plt.xlabel(“This is x axes”)
plt.ylabel(“This is y label”)
plt.title(“This is title of bar graph”)
plt.bar(xdata,ydata)
plt.show()
it will show like:

Question. What is histogram ?
Answer: Histogram is a type of graph that is widely used in Maths or in Statistics. The histogram represents the frequency of occurrence of a specific phenomenon which lie within a specific range of values, which are arranged in consecutive and fixed intervals.
Question. Which function is used to plot histogram?
Answer: matplotlib.pyplot.hist()
Question. What is line chart? Write a program to draw a line chart in Python.
Answer: 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.
# A python program to create a line chart
import matplotlib.pyplot as plt
a=[1,2,3,4,5]
b=[2,4,6,8,10]
plt.plot(a,b)
plt.show()
It shows chart like:

Question. Draw a line graph that shows title, x-axes label and y axes label.
Answer: import matplotlib.pyplot as plt
a=[1,2,3,4,5]
b=[2,4,6,8,10]
plt.title(“My line chart”)
plt.xlabel(“This is x axes”)
plt.ylabel(“This is y axes”)
plt.plot(a,b)
plt.show()
It will look like:
